data = $data; $this->customer = $customer; } /** * Execute the job. * * @return void */ public function handle() { try { $email = new PasswordReset($this->data); Mail::to($this->customer->email)->send($email); \App\Models\Mail::create([ 'template_id' => 4, 'subject' => $email->envelope()->subject, 'to' => $this->customer->email, 'customer_id' => $this->customer->id, 'message' => $email->render() ]); }catch (\Exception $error) { throw new \Exception($error->getMessage()); } } public function failed(\Throwable $exception) { Log::channel('Custom')->info("\r\n"); Log::channel('Custom')->info("================================="); Log::channel('Custom')->info("Thông báo lỗi lúc: " .Carbon::now()); Log::channel('Custom')->info("Notification Create VirtualMachine: "); Log::channel('Custom')->info("========"); Log::channel('Custom')->info($exception->getMessage()); Log::channel('Custom')->info("================================="); } }