I want to send different branded emails. I'm storing the email HTML in the DB because I have an email builder that you just upload an email template made from sendgrid ect and I am passing it to the view blade and escaping all of it. {!!$allhtmlcontent!!}
But then the variables withing the HTML are escaped too and come out like {{$variable}} is there any way to render the blade twice once to pass the HTML with the variables then to pass all the variables in then as well.
I already tried formatting into a string and looking for the variables in the string and pass the whole html string into the blade then.
$emailBlade = CentreEmailTemplate::where('centre_id', $tenant->centre_id)->where('email_template_type_id', 2)->get(); //getting html content
$html = View('emails.Login.LoginDynamic',['html'=>$emailBlade[0]->html_template]); // passing the html content into the blade
$view = $html->render([ // i know this doesnt work :( just demo
'mgrName' => $tenant->name,
'fileUrl' => $fileUrl,
'messageTotal' => $messageTotal,
'isMessageGreater' => $isGreater->message,
'visitorTotal' => $visitorTotal,
'isVisitorGreater' => $isGreater->visitor, //variables that need passed into the html content
'dwellTotal' => $dwellTotal,
'isDwellGreater' => $isGreater->dwell,
'conTotal' => $conTotal,
'isConGreater' => $isGreater->con,
'conRateTotal' => $conRateAvg,
'isConRateGreater' => $isGreater->conRate
]);
just outputs the actual variable name instead of the value.
Thanks in Advance..