renderFromTemplate('vm_credentials', $this->vars())['subject'], ); } public function content(): Content { return new Content( htmlString: $this->renderFromTemplate('vm_credentials', $this->vars())['html'], ); } public function attachments(): array { if ($this->invoicePdf !== null && $this->invoicePdfFileName !== null) { return [ Attachment::fromData(fn () => $this->invoicePdf, $this->invoicePdfFileName) ->withMime('application/pdf'), ]; } return []; } private function payload(): array { try { $setting = Setting::where('key', 'setting')->first(); $settingValue = $setting ? json_decode((string) $setting->value, true) : []; } catch (\Throwable) { $settingValue = []; } return array_merge([ 'support_email' => $settingValue['email'] ?? config('mail.support_email', 'support@thegioiso.com'), 'support_phone' => $settingValue['hotline'] ?? ($settingValue['phone'] ?? config('mail.support_phone', '1900.xxxx')), 'login_url' => rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/dang-nhap', ], $this->data); } private function vars(): array { $data = $this->payload(); $row = fn (string $label, ?string $value) => $value ? "