phplaravelemaillaravel-mail

How to pass markdown text to markdown blade in Laravel?


I need to send markdown e-mail in Laravel but, text of this email must be editable. When I pass $body to a related view, it displays this way:

$body = '''
# Introduction
hi {{ $username }} 
The body of your {{ $family }}.

@component('mail::button', ['url' => ''])
Button Text
@endcomponent
'''

In the related view in blade:

@component('mail::message')

    {{ $body }}

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

and this is output:laravel-output

Does anyone know why this happens?


Solution

  • just change it to view blade:

    {!! $body !!}