Laravel - Mail - Pushing To Specific Queues
Since all mailable classes generated using the make:mail
command make use of the Illuminate\Bus\Queueable
trait, you may call the onQueue
and onConnection
methods on any mailable class instance, allowing you to specify the connection and queue name for the message:
$message = (new OrderShipped($order))
->onConnection('sqs')
->onQueue('emails');
Mail::to($request->user())
->cc($moreUsers)
->bcc($evenMoreUsers)
->queue($message);