Updates for failed emails

This commit is contained in:
David Bomba 2025-03-11 16:56:20 +11:00
parent 2e9d832ad1
commit 875d8ba01a
4 changed files with 31 additions and 2 deletions

View File

@ -806,6 +806,16 @@ class NinjaMailerJob implements ShouldQueue
->send();
$job_failure = null;
try {
if ($this->nmo->invitation) {
$this->nmo->invitation->email_error = substr($errors, 0, 150);
$this->nmo->invitation->save();
}
} catch (\Throwable $e) {
nlog("Problem saving email error: {$e->getMessage()}");
}
}
/**

View File

@ -447,4 +447,14 @@ class ProcessPostmarkWebhook implements ShouldQueue
return [new \Illuminate\Queue\Middleware\WithoutOverlapping($this->request['Tag'])];
}
public function failed($exception = null)
{
if($exception) {
nlog("PROCESSPOSTMARKWEBHOOK:: ". $exception->getMessage());
}
config(['queue.failed.driver' => null]);
}
}

View File

@ -249,7 +249,7 @@ class Invoice extends BaseModel
App::setLocale($locale);
return [
'id' => $this->company->db.":".$this->id,
'id' => (string)$this->company->db.":".$this->id,
'name' => ctrans('texts.invoice') . " " . $this->number . " | " . $this->client->present()->name() . ' | ' . Number::formatMoney($this->amount, $this->company) . ' | ' . $this->translateDate($this->date, $this->company->date_format(), $locale),
'hashed_id' => $this->hashed_id,
'number' => $this->number,
@ -269,7 +269,7 @@ class Invoice extends BaseModel
public function getScoutKey()
{
return $this->company->db.":".$this->id;
return (string)$this->company->db.":".$this->id;
}
public function getEntityType()

View File

@ -903,6 +903,15 @@ class Email implements ShouldQueue
->send();
$job_failure = null;
try {
if($this->email_object->invitation){
$this->email_object->invitation->email_error = substr($errors, 0, 150);
$this->email_object->invitation->save();
}
}catch(\Throwable $e){
nlog("Problem saving email error: {$e->getMessage()}");
}
}
/**