I have Laravel 10 as my API backend with Fortify. When resetting the password, I want to send HTML content (retrieved from the database) to an email. The email should be queued, possibly via the jobs table.
In FortifyServiceProvider, I have tried the toMailUsing method.
ResetPassword::toMailUsing(function (User $user, string $token) {
return (new ResetEmail($user, $token))->onQueue('send-email');
});
But this email needs to be queued and sent directly.
FYI: I am already running send-email queue to send other emails, and it is working perfectly fine (via Jobs). And yes, I do have set this in .env QUEUE_CONNECTION=database
In laravel source i have found this:
if ($message instanceof Mailable) {
return $message->send($this->mailer);
}
This is supposed to handle the queued Mailable as well, right? Or am I heading in the wrong direction?
Source:10.x/src/Illuminate/Notifications/Channels/MailChannel.php#L63