fix: SMTP-Auth via info@nimu.li, FROM-Adresse je Template auf aziros.com setzen
Die aziros.com-Postfächer (hello/noreply) können sich nicht direkt am SMTP authentifizieren. Lösung: smtp-Mailer (info@nimu.li) für Auth verwenden, FROM-Header per ->from() auf die korrekte aziros.com-Adresse setzen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main
parent
a023ed19f6
commit
f76ea32076
|
|
@ -58,14 +58,15 @@ class ProcessMailQueue extends Command
|
||||||
|
|
||||||
$html = view('emails.' . $mail->template, $mail->meta)->render();
|
$html = view('emails.' . $mail->template, $mail->meta)->render();
|
||||||
|
|
||||||
$mailerName = match(true) {
|
[$fromAddress, $fromName] = match(true) {
|
||||||
str_starts_with($mail->template, 'auth.') => 'hello',
|
str_starts_with($mail->template, 'auth.') => ['hello@aziros.com', 'Aziros'],
|
||||||
default => 'system',
|
default => ['noreply@aziros.com', 'Aziros'],
|
||||||
};
|
};
|
||||||
|
|
||||||
Mail::mailer($mailerName)->html($html, function ($message) use ($mail) {
|
Mail::mailer('smtp')->html($html, function ($message) use ($mail, $fromAddress, $fromName) {
|
||||||
$message->to($mail->to)
|
$message->to($mail->to)
|
||||||
->subject($mail->subject ?? 'Mail');
|
->subject($mail->subject ?? 'Mail')
|
||||||
|
->from($fromAddress, $fromName);
|
||||||
});
|
});
|
||||||
|
|
||||||
$mail->update([
|
$mail->update([
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue