У меня есть шаблон базы данных для электронной почты с переменными и т. Д. Когда я передаю этот шаблон в моем представлении, переменные базы данных не отображаются и отображаются {{$ child_fullname}}, {{$ special_fullname}} и т. Д. Вместособственное имя.
Вот моя функция сборки Mail:
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:
<!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>
Результат: ![enter image description here](https://i.stack.imgur.com/4uG6I.png)
Заранее благодарен за помощь!
PS С помощью этого вы можете отправить электронное письмо.