data = $data; $this->customer = $customer; } public function handle() { try { $email = new CreateHosting(3,$this->data); Mail::to($this->customer->email)->send($email); \App\Models\Mail::create([ 'template_id' => 3, 'subject' => $email->envelope()->subject, 'to' => $this->customer->email, 'customer_id' => $this->customer->id, 'message' => $email->render() ]); } catch (\Exception $exception) { throw new \Exception( $exception->getMessage()); } } public function failed(\Throwable $exception, Telegram $telegram) { Log::channel('Custom')->info("================================="); Log::channel('Custom')->info("Thông báo lỗi lúc: " .Carbon::now()); Log::channel('Custom')->info("Notification Send Information Hosting: "); Log::channel('Custom')->info("========"); Log::channel('Custom')->info($exception->getMessage()); Log::channel('Custom')->info("================================="); $telegram->SendErrorMessage(json_decode($exception->getMessage())); } }