diff --git a/src/app/Console/Commands/ProcessMailQueue.php b/src/app/Console/Commands/ProcessMailQueue.php index 8f71565..916afd4 100644 --- a/src/app/Console/Commands/ProcessMailQueue.php +++ b/src/app/Console/Commands/ProcessMailQueue.php @@ -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([