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
# Wir erstellen nun zunächst den Inhalt der Datei:
$data = [];
$new = 0;
$emailAddress = "";
foreach ($request->all() as $key => $value) {
if ($key === "filename" || $value === "") {
......@@ -135,6 +136,10 @@ class MailController extends Controller
$key = substr($key, strpos($key, "_new_") + 5);
}
$key = trim($key);
if($key === "email") {
$emailAddress = $value;
continue;
}
if (!strpos($key, "#")) {
$data[$key] = $value;
} else {
......@@ -179,8 +184,14 @@ class MailController extends Controller
$ex["new"] += $new;
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)));
}
}
$ex = base64_encode(serialize($ex));
return redirect(url('languages/edit', ['from' => $from, 'to' => $to, 'exclude' => $ex]));
......
......@@ -15,10 +15,10 @@ class Sprachdatei extends Mailable
*
* @return void
*/
public function __construct($message, $fileContent, $filename)
public function __construct($message, $fileContent, $filename, $replyAddress = "noreply@metager.de")
{
$this->subject = "MetaGer - Sprachdatei";
$this->reply = "noreply@metager.de";
$this->reply = $replyAddress;
$this->message = $message;
$this->fileContent = $fileContent;
$this->filename = $filename;
......
......@@ -55,5 +55,7 @@
<p>{{ trans('languages.hinweis.1') }}</p>
<p>{!! trans('languages.hinweis.2') !!}</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>
@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