fixed small mail setting
This commit is contained in:
@@ -63,8 +63,15 @@ class MarketingController extends Controller
|
||||
]);
|
||||
|
||||
$locale = app()->getLocale();
|
||||
$contactAddress = config('mail.contact_address', config('mail.from.address')) ?: 'admin@fotospiel.de';
|
||||
$contactAddress = config('mail.contact_address', config('mail.from.address'));
|
||||
|
||||
if (! $contactAddress) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => __('marketing.contact.error_recipient_missing', [], $locale) ?: 'Anfrage derzeit nicht möglich. Bitte später erneut versuchen.',
|
||||
]);
|
||||
}
|
||||
|
||||
try {
|
||||
Mail::raw(
|
||||
__('emails.contact.body', [
|
||||
'name' => $request->name,
|
||||
@@ -80,6 +87,16 @@ class MarketingController extends Controller
|
||||
Mail::to($request->email)
|
||||
->locale($locale)
|
||||
->queue(new ContactConfirmation($request->name));
|
||||
} catch (\Throwable $exception) {
|
||||
Log::error('Contact form mail failed', [
|
||||
'error' => $exception->getMessage(),
|
||||
'code' => $exception->getCode(),
|
||||
]);
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'email' => __('marketing.contact.error_send_failed', [], $locale) ?: 'Nachricht konnte nicht gesendet werden. Bitte versuche es später erneut.',
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->back()
|
||||
|
||||
Reference in New Issue
Block a user