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();
|
||||
|
||||
$mailerName = match(true) {
|
||||
str_starts_with($mail->template, 'auth.') => 'hello',
|
||||
default => 'system',
|
||||
[$fromAddress, $fromName] = match(true) {
|
||||
str_starts_with($mail->template, 'auth.') => ['hello@aziros.com', 'Aziros'],
|
||||
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)
|
||||
->subject($mail->subject ?? 'Mail');
|
||||
->subject($mail->subject ?? 'Mail')
|
||||
->from($fromAddress, $fromName);
|
||||
});
|
||||
|
||||
$mail->update([
|
||||
|
|
|
|||
Loading…
Reference in New Issue