data = $data; } public function handle(): void { if (empty($this->data['customer_email'])) { Log::warning('HostingAccountCreatedJob: missing customer_email, skipped.', [ 'domain_name' => $this->data['domain_name'] ?? null, ]); return; } try { Mail::to($this->data['customer_email']) ->send(new HostingAccountCreated($this->data)); } catch (\Throwable $e) { Log::error('Không thể gửi email thông báo khởi tạo hosting: ' . $e->getMessage(), [ 'customer_email' => $this->data['customer_email'] ?? null, 'domain_name' => $this->data['domain_name'] ?? null, ]); } } public function failed(\Throwable $e): void { Log::error('HostingAccountCreatedJob: job failed.', [ 'error' => $e->getMessage(), 'domain_name' => $this->data['domain_name'] ?? null, ]); } }