Enter your keyword

Preview mails, notifications in the browser

Preview mails, notifications in the browser

Hello, been troubled with debugging the look and feel of your emails or notifications in Laravel. There is a way to render/preview your mailable blades right from the comfort of your browser, without first sending out the actual email.

Let’s create a sales receipt mailable.

php artisan make:mail SalesReceipt --markdown=mails.sales.receipt

The artisan command will create a Mailable class App\Mail\SalesReceipt and a markdown mail template resources/views/mails/sales/receipt.blade.php.

Mailable:

Markdown:

Routes:

Laravel 5.5+

Laravel 5.4

Passing data to markdown blade

Mailable:

Markdown: 

Laravel 5.5+

Laravel 5.4

Note: Don’t indent your markdown blades in the IDE, it may be rendered wrongly.

That’s all. Stay tuned for more…