Commit 7dd9ec23 authored by Aria Givi's avatar Aria Givi
Browse files

Emailfeld für Rückfragen hinzugefügt

parent d830514e
...@@ -124,6 +124,7 @@ class MailController extends Controller ...@@ -124,6 +124,7 @@ class MailController extends Controller
# Wir erstellen nun zunächst den Inhalt der Datei: # Wir erstellen nun zunächst den Inhalt der Datei:
$data = []; $data = [];
$new = 0; $new = 0;
$emailAddress = "";
foreach ($request->all() as $key => $value) { foreach ($request->all() as $key => $value) {
if ($key === "filename" || $value === "") { if ($key === "filename" || $value === "") {
...@@ -135,6 +136,10 @@ class MailController extends Controller ...@@ -135,6 +136,10 @@ class MailController extends Controller
$key = substr($key, strpos($key, "_new_") + 5); $key = substr($key, strpos($key, "_new_") + 5);
} }
$key = trim($key); $key = trim($key);
if($key === "email") {
$emailAddress = $value;
continue;
}
if (!strpos($key, "#")) { if (!strpos($key, "#")) {
$data[$key] = $value; $data[$key] = $value;
} else { } else {
...@@ -179,8 +184,14 @@ class MailController extends Controller ...@@ -179,8 +184,14 @@ class MailController extends Controller
$ex["new"] += $new; $ex["new"] += $new;
if ($new > 0) { if ($new > 0) {
Mail::to("dev@suma-ev.de") if($emailAddress !== "") {
Mail::to("dev@suma-ev.de")
->send(new Sprachdatei($message, $output, basename($filename), $emailAddress));
}
else {
Mail::to("dev@suma-ev.de")
->send(new Sprachdatei($message, $output, basename($filename))); ->send(new Sprachdatei($message, $output, basename($filename)));
}
} }
$ex = base64_encode(serialize($ex)); $ex = base64_encode(serialize($ex));
return redirect(url('languages/edit', ['from' => $from, 'to' => $to, 'exclude' => $ex])); return redirect(url('languages/edit', ['from' => $from, 'to' => $to, 'exclude' => $ex]));
......
...@@ -15,10 +15,10 @@ class Sprachdatei extends Mailable ...@@ -15,10 +15,10 @@ class Sprachdatei extends Mailable
* *
* @return void * @return void
*/ */
public function __construct($message, $fileContent, $filename) public function __construct($message, $fileContent, $filename, $replyAddress = "noreply@metager.de")
{ {
$this->subject = "MetaGer - Sprachdatei"; $this->subject = "MetaGer - Sprachdatei";
$this->reply = "noreply@metager.de"; $this->reply = $replyAddress;
$this->message = $message; $this->message = $message;
$this->fileContent = $fileContent; $this->fileContent = $fileContent;
$this->filename = $filename; $this->filename = $filename;
......
...@@ -55,5 +55,7 @@ ...@@ -55,5 +55,7 @@
<p>{{ trans('languages.hinweis.1') }}</p> <p>{{ trans('languages.hinweis.1') }}</p>
<p>{!! trans('languages.hinweis.2') !!}</p> <p>{!! trans('languages.hinweis.2') !!}</p>
<p>{!! trans('languages.hinweis.3') !!}</p> <p>{!! trans('languages.hinweis.3') !!}</p>
<p><b>E-Mail-Adresse für Rückfragen</b> (optional):</p>
<p><input type="email" form="submit" name="{{ base64_encode("email") }}" placeholder="name@provider.com"/></input></p>
<button class="btn btn-success" type="submit" form="submit">Daten übermitteln</button> <button class="btn btn-success" type="submit" form="submit">Daten übermitteln</button>
@endsection @endsection
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment