Skip to content

Instantly share code, notes, and snippets.

@carltondickson
Last active May 30, 2022 03:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carltondickson/ad979cc684027b64c0ff95383ae1c18c to your computer and use it in GitHub Desktop.
Save carltondickson/ad979cc684027b64c0ff95383ae1c18c to your computer and use it in GitHub Desktop.
Laravel Queue mailable via tinker
// Create mailable, e.g. MailableTest
php artisan make:mail MailableTest --markdown=emails.mailable-test
// Run horizon or queue worker
// Open tinker
$mailable = (new \App\Mail\MailableTest())->onQueue('queue-name');
Mail::to('somemail@example.com')->send($mailable);
@dilab
Copy link

dilab commented Aug 3, 2020

This does not seem to work. Laravel will send the email synchronously.
Below worked:

Mail::to('no-reply@carlite.com.sg')->queue($mailable);

@madurapa
Copy link

@carltondickson Thanks, @dilab method works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment