emailTemplate = $emailTemplate; $this->data = $data; $this->data['body'] = $this->emailTemplate->body; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: $this->emailTemplate->subject, ); } /** * Get the message content definition. */ 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: $viewData, ); } }