mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for mailers
This commit is contained in:
parent
731001baf5
commit
6840e3e471
@ -76,7 +76,8 @@ class EmailCredit extends BaseMailerJob implements ShouldQueue
|
||||
if (count(Mail::failures()) > 0) {
|
||||
event(new CreditWasEmailedAndFailed($this->credit, $this->credit->company, Mail::failures(), Ninja::eventVars()));
|
||||
|
||||
return $this->logMailError($errors);
|
||||
return $this->logMailError(Mail::failures(), $this->credit->client);
|
||||
|
||||
}
|
||||
|
||||
//fire any events
|
||||
|
@ -80,18 +80,9 @@ class EmailInvoice extends BaseMailerJob implements ShouldQueue
|
||||
);
|
||||
|
||||
if (count(Mail::failures()) > 0) {
|
||||
return $this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->invoice->client);
|
||||
}
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->invoice->client
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -83,21 +83,12 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
//catch errors
|
||||
if (count(Mail::failures()) > 0) {
|
||||
$this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->payment->client);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->payment->client
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -82,21 +82,11 @@ class EntitySentMailer extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
//catch errors
|
||||
if (count(Mail::failures()) > 0) {
|
||||
$this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->entity->client);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->entity->client
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -83,21 +83,11 @@ class EntityViewedMailer extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
//catch errors
|
||||
if (count(Mail::failures()) > 0) {
|
||||
$this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->invoice->client);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->invoice->client
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ class PaymentFailureMailer extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
//catch errors
|
||||
if (count(Mail::failures()) > 0) {
|
||||
$this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->client);
|
||||
}
|
||||
|
||||
}
|
||||
@ -102,16 +102,5 @@ class PaymentFailureMailer extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->client
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue
|
||||
|
||||
//Catch errors and report.
|
||||
if (count(Mail::failures()) > 0) {
|
||||
$this->logMailError(Mail::failures());
|
||||
return $this->logMailError(Mail::failures(), $this->company);
|
||||
}
|
||||
|
||||
}
|
||||
@ -94,15 +94,4 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue
|
||||
];
|
||||
}
|
||||
|
||||
private function logMailError($errors)
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$errors,
|
||||
SystemLog::CATEGORY_MAIL,
|
||||
SystemLog::EVENT_MAIL_SEND,
|
||||
SystemLog::TYPE_FAILURE,
|
||||
$this->company
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user