Closed Sauruz closed 3 years ago
Nevermind, this is the way Laravel handles queues. $template is a model in my application. When you change the the model ($template->body) it's not changed in the DB. The queue fetches the model from te DB so it wont have the rendered body.
Hi terreporter, great package! There's a problem i'm facing and don't know how to solve it.
I'm using compiled strings in my mailables like this:
$template->body = view (['template' => $template->body], ['member' => $member->toArray()]);
this works fine when sending mail like this:
Mail::to($member->email)->send(new MemberMail($member));
however the variables in the template are not rendered when sending the mail using queues like this
Mail::to($member->email)->queue(new MemberMail($member));
Any solutions?