fix: ensure email body is fresh from template during queue execution

This commit is contained in:
2026-01-25 15:12:34 -05:00
parent 259a905ea5
commit 17061d0c35
2 changed files with 9 additions and 2 deletions

View File

@@ -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,
);
}
}