From 38c22f29b2fb0492a959a3c5c5112d8d463b7006 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 3 Apr 2024 17:37:21 +1100 Subject: [PATCH] Minor fixes --- app/Jobs/Mail/NinjaMailerJob.php | 16 ++++++++++++---- app/Services/Email/Email.php | 9 +++++++-- lang/en/texts.php | 3 ++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index bff1f3f5aa7c..8ec580d0d4b0 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -70,9 +70,7 @@ class NinjaMailerJob implements ShouldQueue public function backoff() { - // return [5, 10, 30, 240]; - return [rand(5, 10), rand(30, 40), rand(60, 79), rand(160, 400)]; - + return [rand(5, 29), rand(30, 59), rand(61, 100), rand(180, 500)]; } public function handle() @@ -182,6 +180,11 @@ class NinjaMailerJob implements ShouldQueue $this->fail(); $this->logMailError($e->getMessage(), $this->company->clients()->first()); + + if ($this->nmo->entity) { + $this->entityEmailFailed($message); + } + $this->cleanUpMailers(); return; @@ -195,6 +198,11 @@ class NinjaMailerJob implements ShouldQueue $this->fail(); $this->logMailError($message, $this->company->clients()->first()); + + if ($this->nmo->entity) { + $this->entityEmailFailed($message); + } + $this->cleanUpMailers(); return; @@ -203,7 +211,7 @@ class NinjaMailerJob implements ShouldQueue //only report once, not on all tries if ($this->attempts() == $this->tries) { - /* If the is an entity attached to the message send a failure mailer */ + /* If there is an entity attached to the message send a failure mailer */ if ($this->nmo->entity) { $this->entityEmailFailed($message); } diff --git a/app/Services/Email/Email.php b/app/Services/Email/Email.php index c07d34515a0f..96faccf0d576 100644 --- a/app/Services/Email/Email.php +++ b/app/Services/Email/Email.php @@ -93,7 +93,7 @@ class Email implements ShouldQueue */ public function backoff() { - return [rand(10, 20), rand(30, 45), rand(60, 79), rand(160, 400)]; + return [rand(5, 29), rand(30, 59), rand(61, 100), rand(180, 500)]; } /** @@ -314,6 +314,8 @@ class Email implements ShouldQueue $this->logMailError($e->getMessage(), $this->company->clients()->first()); $this->cleanUpMailers(); +$this->entityEmailFailed($message); + return; } @@ -329,6 +331,8 @@ class Email implements ShouldQueue $this->logMailError($message, $this->company->clients()->first()); $this->cleanUpMailers(); + $this->entityEmailFailed($message); + return; } @@ -343,11 +347,12 @@ class Email implements ShouldQueue if ($message_body && property_exists($message_body, 'Message')) { $message = $message_body->Message; - nlog($message); } $this->fail(); + $this->entityEmailFailed($message); $this->cleanUpMailers(); + return; } diff --git a/lang/en/texts.php b/lang/en/texts.php index ce6272208f75..6f76b8b86197 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -3155,7 +3155,7 @@ $lang = array( 'archived_group' => 'Successfully archived group', 'deleted_group' => 'Successfully deleted group', 'restored_group' => 'Successfully restored group', - 'upload_logo' => 'Upload Logo', + 'upload_logo' => 'Upload Your Company Logo', 'uploaded_logo' => 'Successfully uploaded logo', 'saved_settings' => 'Successfully saved settings', 'device_settings' => 'Device Settings', @@ -5271,6 +5271,7 @@ $lang = array( 'show_table_footer' => 'Show table footer', 'show_table_footer_help' => 'Displays the totals in the footer of the table', 'total_invoices' => 'Total Invoices', + 'add_to_group' => 'Add to group', ); return $lang;