From eb82cf4964c060bd6eb9f56f68c6222c9ce7985a Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 4 Feb 2026 18:15:18 +0100 Subject: [PATCH] wait #7973 @2 --- app/Jobs/ProcessEmailBatch.php | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/app/Jobs/ProcessEmailBatch.php b/app/Jobs/ProcessEmailBatch.php index 06358d7..0ab4552 100644 --- a/app/Jobs/ProcessEmailBatch.php +++ b/app/Jobs/ProcessEmailBatch.php @@ -149,18 +149,25 @@ class ProcessEmailBatch implements ShouldQueue $this->templateVariables = $this->processVariablesForMailer(); foreach ($this->users as $user) { - Mail::send([], [], function ($message) use ($user) { - $h = $this->html; - $h = str_replace('%name%', $user->name, $h); - $h = str_replace('%url%', $this->batch->file->getMailableUrl($user), $h); - $h = str_replace('%cover%', $this->batch->file->coverUrl, $h); - - $message->from(config('mail.from.address'), config('mail.from_name')); - $message->subject($this->batch->subject); - $message->setBody($h, 'text/html'); - $message->to($user->email); - $message->replyTo(env('MAIL_REPLYTO')); - }); + for ($j = 0; $j < 4; $j++) { + try { + Mail::send([], [], function ($message) use ($user) { + $h = $this->html; + $h = str_replace('%name%', $user->name, $h); + $h = str_replace('%url%', $this->batch->file->getMailableUrl($user), $h); + $h = str_replace('%cover%', $this->batch->file->coverUrl, $h); + + $message->from(config('mail.from.address'), config('mail.from_name')); + $message->subject($this->batch->subject); + $message->setBody($h, 'text/html'); + $message->to($user->email); + $message->replyTo(env('MAIL_REPLYTO')); + }); + break; + } catch (\Exception $e) { + sleep(30); + } + } $this->processUpdate([ 'status' => 'processing', -- 2.39.5