Laravel- using @foreach in mail

I am trying to use a loop @foreachinside a markdown template to send letters.

When using HTML tags inside @foreach, it does not display correctly

@component('mail::message')

These are the latest contents in our website

@foreach($results as $type => $result)
   <h4>{{ $result['name'] }}</h4>
@endforeach

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

In the mail received, the tag <h4>will be displayed as

<h4>Article</h4>

Markdown is not processed when it is placed inside a loop @foreach. But it is processed when placed outside the loop @foreach.

Any help would be greatly appreciated. Thanks.

+6
source share
1 answer

As stated in the laravel documentation :

Markdown. .

HTML-, @foreach, ( , 4 <h4>):

<h4>Article</h4>
0

All Articles