independent full stack developer

/ Developer's blog

Laravel 5.4 markdown email doesn't render HTML

Monday, September 20, 2021

If you ever stumbled with question why your markdown email in Laravel doesn't render properly, you have to know - that you need to remove any tabs/spaces before lines, so if you like to press CTRL+ALT+L and format your template pretty, be aware that it will broke your mail template :)

Be sure that your template looks like this.

@component('mail::message')
# Invoice Paid

Your invoice has been paid!

@component('mail::button', ['url' => ''])
View Invoice
@endcomponent

Thanks,
{{ config('app.name') }}
@endcomponent

 

2741 people already saw it