This gist is about adding support for Mailgun's parameters (o:tag, o:testmode, etc..) to your application.
-
Add these files to your Laravel project :
app/Mail/TransportManager.phpapp/Mail/Transport/MailgunTransport.phpapp/Providers/MailServiceProvider.php
-
In
app.php, replace the lineIlluminate\Mail\MailServiceProvider::class,withApp\Providers\MailServiceProvider::class,
- You can test your options using the provided command
app/Console/Commands/MailgunParameterTest.php - Add the following line to the
$commandarray inapp/Console/Kernel.php:MailgunParameterTest::class, - Run the test in console :
php artisan test:mailgun-parameter-test --to=%yourEmailAddressHere% - Have a look at your Mailgun Logs and your should see a "Test delievered" entry! :)
If you use a mailable Class (like
Mail::to(...)->send(new ClassName())) you don't need this.You can simply build the Mailgun Tags in your class build method: