Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.4 Markdown email character issue

I'm using Laravel 5.4, I'm sending a Markdown mailable with the following code:

public function build()
{
    return $this->markdown('emails.userWasRegistered')
        ->with('user', $this->user);
}

markdown

@component('mail::message')

    # Welcome

    Thank you for registering, you are registered as a {{ $user->role }}

    @component('mail::button', ['url' => $url])
    Login
    @endcomponent

@endcomponent

But the output isn't what it's supposed to be, right?

HTML

enter image description here

HTML source

enter image description here

Any idea what might be going wrong?

like image 453
Miguel Stevens Avatar asked Jan 04 '23 13:01

Miguel Stevens


1 Answers

I know what's going on. It's because you indented your template. In markdown when you indent something that's interpreted as a "code-block", which should be displayed as-is instead of computed, if you know what I mean.

like this you <strong>see</strong>?

So just don't indent your code.

like image 96
Evert Avatar answered Jan 08 '23 00:01

Evert