emailData['os_name'] ?? '', $this->emailData['client_name'] ?? '', $this->emailData['company_name'] ?? '', ], $this->template->subject ); return new Envelope(subject: $subject); } public function content(): Content { try { $renderer = app(EmailNotificationTemplateRenderer::class); $html = $renderer->renderVmCredentials($this->template, $this->emailData, $this->invoice); return new Content(htmlString: $html); } catch (\Throwable $e) { Log::warning('VmCredentialsMail: renderer failed, falling back to plain message', [ 'template_id' => $this->template->id, 'error' => $e->getMessage(), ]); return new Content(htmlString: '
Thông tin dịch vụ đã được chuẩn bị. Vui lòng liên hệ hỗ trợ nếu cần.
'); } } public function attachments(): array { if ($this->invoicePdf !== null && $this->invoicePdfFileName !== null) { return [ Attachment::fromData(fn() => $this->invoicePdf, $this->invoicePdfFileName) ->withMime('application/pdf'), ]; } return []; } }