I have in database template for email with variables ant etc.. When I pass that template in my view from database variable are not rendered and displayed {{ $child_fullname }}, {{ $specialist_fullname }} and etc. instead of given name.
Here is my Mail build function:
public function build()
{
return $this->subject('Pranešimas apie sėkmingą registraciją')
->view('email-template')
->with([
'body' => EmailTemplate::find(1)->text,
'child_fullname' => $this->child->name . ' ' . $this->child->surname,
'specialist_fullname' => $this->card->specialist->name,
'date_time' => $this->visits->workSchedule->work_date .
' ' . $this->visits->workSchedule->work_time
]);
}
Blade template:
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
{!! $body !!}
</html>
Thanks in advance for help!
P.S Using this to send email.
