fix: ensure email body is fresh from template during queue execution
This commit is contained in:
@@ -46,9 +46,14 @@ class Mail extends Mailable
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
// Always get fresh body from the template to handle queue serialization properly
|
||||
$viewData = $this->data;
|
||||
$viewData['body'] = $this->emailTemplate->body ?? '';
|
||||
$viewData['data'] = $viewData; // Ensure 'data' key exists for BladeCompiler::render
|
||||
|
||||
return new Content(
|
||||
html: 'components.mail.base',
|
||||
with: $this->data,
|
||||
with: $viewData,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user