Enter your keyword

Preview mails, notifications in browser

Preview mails, notifications in browser

Hello, been troubled with debugging the look and feel of your emails or notifications in Laravel. There is a way to render/preview you mailable blades right from the comfort of your broswer, 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

You may pass data the blade in the render(). Let take this example…

Markdown: 

Laravel 5.4

Laravel 5.5+

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

That’s all. Stay tuned for more…