mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
error handling for mail
This commit is contained in:
parent
5cd2ae0dbe
commit
ef9043db44
@ -12,8 +12,10 @@
|
||||
namespace App\Jobs\Mail;
|
||||
|
||||
use App\DataMapper\Analytics\EmailFailure;
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Libraries\Google\Google;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\SystemLog;
|
||||
use App\Models\User;
|
||||
use App\Providers\MailServiceProvider;
|
||||
use App\Utils\Ninja;
|
||||
@ -75,7 +77,7 @@ class BaseMailerJob implements ShouldQueue
|
||||
}
|
||||
|
||||
public function logMailError($errors, $recipient_object)
|
||||
{info(print_r($errors,1));
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
|
@ -94,14 +94,17 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue
|
||||
}catch(\Exception $e) {
|
||||
|
||||
info("mailing failed with message " . $e->getMessage());
|
||||
|
||||
event(new PaymentWasEmailedAndFailed($this->payment, $this->company, Mail::failures(), Ninja::eventVars()));
|
||||
return $this->logMailError($e->getMessage(), $this->payment->client);
|
||||
|
||||
}
|
||||
|
||||
if (count(Mail::failures()) > 0) {
|
||||
event(new PaymentWasEmailedAndFailed($this->payment, Mail::failures(), Ninja::eventVars()));
|
||||
// if (count(Mail::failures()) > 0) {
|
||||
// info("logging mail failures");
|
||||
// info(print_r(Mail::failures(),1));
|
||||
|
||||
return $this->logMailError(Mail::failures());
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
event(new PaymentWasEmailed($this->payment, $this->payment->company, Ninja::eventVars()));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user