payload()['subject'] ?? 'Thông báo trạng thái nạp tiền', ); } public function content(): Content { $data = $this->payload(); return new Content( view: 'emails.customer.manual-deposit-status', with: [ 'companyName' => $data['company_name'] ?? config('app.name', 'The Gioi So'), 'companyLogo' => $data['company_logo'] ?? '', 'customerName' => $data['customer_name'] ?? 'Quý khách', 'transactionCode' => $data['transaction_code'] ?? 'N/A', 'amount' => $data['amount'] ?? 0, 'amountFormatted' => number_format((float) ($data['amount'] ?? 0), 0, ',', '.'), 'statusLabel' => $data['status_label'] ?? 'Đang chờ duyệt', 'statusColor' => $data['status_color'] ?? '#f16723', 'statusBg' => $data['status_bg'] ?? '#fff7ed', 'statusMessage' => $data['status_message'] ?? ($data['message'] ?? ''), 'depositDate' => $data['deposit_date'] ?? now()->format('d/m/Y H:i:s'), 'processedDate' => $data['processed_date'] ?? null, 'portalUrl' => $data['portal_url'] ?? rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/nap-tien', 'supportEmail' => $data['support_email'] ?? config('mail.support_email', 'support@thegioiso.com'), 'supportPhone' => $data['support_phone'] ?? config('mail.support_phone', '1900.xxxx'), ], ); } public function attachments(): array { 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([ 'company_name' => $settingValue['company'] ?? config('app.name', 'The Gioi So'), 'company_logo' => $settingValue['logo'] ?? '', 'support_email' => $settingValue['email'] ?? config('mail.support_email', 'support@thegioiso.com'), 'support_phone' => $settingValue['hotline'] ?? ($settingValue['phone'] ?? config('mail.support_phone', '1900.xxxx')), 'portal_url' => rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/nap-tien', ], $this->data); } }