I am using Laravel markdown to send email to users.
The problem I am facing is when I tried to embed some HTML block inside an email.
I need to send HTML block in email, because I want to tell them know how to setup widget into their website.
If the HTML block is present, it is not rendered correctly.
How can I solve this?
:::Sample code:::
//Mailable class:
$greeting = Hi User;
$content = "
<div id="mainDiv" data-widget="main" data-code="{{$code}}"></div>
<script type="text/javascript" src="https://domain/js/main.js"></script>";
return (new MailMessage())
->subject($subject)
->markdown('email', [
'greeting' => $greeting,
'content' => $content
]);
//Template for email
@component('mail::message')
{{ $greeting }}
{!! $content !!}