E-Mail-Benachrichtigungen für Mitgliedsanträge
This commit is contained in:
parent
1328354827
commit
a0e85de7bd
4 changed files with 93 additions and 7 deletions
|
|
@ -59,6 +59,7 @@ class HomeController
|
|||
'aufnahme_ab' => 'required',
|
||||
'kontoinhaber' => 'required',
|
||||
'iban' => 'required',
|
||||
'email' => 'required|email',
|
||||
]);
|
||||
|
||||
$signature1 = $this->decodeSignature((string) input('unterschrift_1'));
|
||||
|
|
@ -144,12 +145,7 @@ class HomeController
|
|||
redirect('/mitgliedsantrag');
|
||||
}
|
||||
|
||||
$baseUrl = rtrim((string) config('app.url'), '/');
|
||||
|
||||
if ($baseUrl === '' || str_contains($baseUrl, 'localhost')) {
|
||||
$baseUrl = 'https://motorrad-ig.de';
|
||||
}
|
||||
|
||||
$baseUrl = app_base_url();
|
||||
$adminUrl = $baseUrl . '/admin/antraege/' . $application->id;
|
||||
|
||||
$body = "Neuer Mitgliedsantrag über die Website\n"
|
||||
|
|
@ -186,6 +182,28 @@ class HomeController
|
|||
$email
|
||||
);
|
||||
|
||||
$applicantBody = "Hallo " . trim($vorname . ' ' . $nachname) . ",\n\n"
|
||||
. "vielen Dank für deinen Mitgliedsantrag. Wir haben deinen Antrag am "
|
||||
. date('d.m.Y H:i') . " erhalten.\n\n"
|
||||
. "Antragsnummer: " . $application->id . "\n"
|
||||
. "E-Mail: " . $email . "\n\n"
|
||||
. "Wir prüfen deinen Antrag und melden uns bei dir, sobald er bearbeitet wurde.\n\n"
|
||||
. "Viele Grüße\n"
|
||||
. "Motorrad-IG\n"
|
||||
. $baseUrl . "\n";
|
||||
|
||||
if (!send_mail($email, 'Dein Mitgliedsantrag bei der Motorrad-IG', $applicantBody, 'Motorrad-IG <motorradig@aol.com>')) {
|
||||
app_log('warning', 'Bestätigungs-E-Mail an Antragsteller fehlgeschlagen', [
|
||||
'application_id' => $application->id,
|
||||
'email' => $email,
|
||||
]);
|
||||
} else {
|
||||
app_log('info', 'Bestätigungs-E-Mail an Antragsteller gesendet', [
|
||||
'application_id' => $application->id,
|
||||
'email' => $email,
|
||||
]);
|
||||
}
|
||||
|
||||
app_log('info', 'Mitgliedsantrag gespeichert', [
|
||||
'application_id' => $application->id,
|
||||
'email' => $email,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue