I think I'm doing something worng.
I'm trying to pass a variable into an Email View. This varaibvle is read from the database and is configurable via administration page. For some reason, I'm getting the emails without the HTML paser (I see tags like in them) I wanted them to be parsed, so my client can manually change them everytime he wants.
How is that achievable?
My code is:
Mail::send('emails.contact', array(
'name' => $request->get('name'),
'email' => $request->get('email'),
'user_message' => $request->get('message'),
'email_content' => html_entity_decode($emailContent->Description)
), function($message) use ($result)
{
$message->from(env('MAIL_USERNAME'));
$message->to($result['From'], $result['Name']);
$message->subject('[Casa Bordeira] We received your message');
});
An in the view:
<div class="contentEditableContainer contentTextEditable">
<div class="contentEditable" align='left' >
<p>
Hello <strong>{{$name}}</strong>.
<br/>
{{$email_content}}
<br/>
<br/>
<br/>
Here's a copy of your message:
<br/>
<br/>
{{$user_message}}
</p>
</div>
</div>
Blade has two different tag styles.
{{ $string }} - this will escape the content using HTML entities.
{!! $string !!} - this does not escape the content and will output the raw HTML value.
See the docs for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With