Show html in blade email Hi,
I'm trying to show html in an email that is being made with trix editor .
@foreach ($outroLines as $line)
<p style="{{ $style['paragraph'] }}">
{{ html_entity_decode($line) }}
</p>
@endforeach
But when I receive the mail I see the plain html.
What could be the case?
delete
{{ html_entity_decode($line) }}
and try
{!! html_entity_decode($line) !!}
Have you tried: {!! html_entity_decode($line) !!}
Hope this work for you..! If not, what's the error given.
For testing, try and check:
@foreach ($outroLines as $line)
<?php
print('<pre style="color:red;">');
print_r($line);
print('</pre>');
?>
@endforeach
@mehany already have that I'm using Laravel's default email.
@lars6 That was not the solution, given it for check the $line. Let me know what it does print for you?
@lars6 Please mention laravel version.
@lars6 : If $line contain <div>test</div>, {!! $line !!} should be work. If still not working then review the problem and update question as per.
@lars6 Please check if "laravelcollective/html": "5.3.*" package installed in your project. You can check it in composer.json file. If it is not installed, make it install and html will work like charm.
Thanks,
Please sign in or create an account to participate in this conversation.