diff --git a/app/Listeners/InvoiceListener.php b/app/Listeners/InvoiceListener.php index 014cbe64bcd3..3888ccbda063 100644 --- a/app/Listeners/InvoiceListener.php +++ b/app/Listeners/InvoiceListener.php @@ -153,6 +153,14 @@ class InvoiceListener public function jobFailed(JobExceptionOccurred $exception) { + if ($errorEmail = env('ERROR_EMAIL')) { + \Mail::raw(print_r($exception->data, true), function ($message) use ($errorEmail) { + $message->to($errorEmail) + ->from(CONTACT_EMAIL) + ->subject('Job failed'); + }); + } + Utils::logError($exception->exception); } }