From a88e2d318b88316329f035120e2b5a9744c16680 Mon Sep 17 00:00:00 2001 From: Tarvo R Date: Fri, 30 Jun 2023 18:28:06 +0300 Subject: [PATCH] Pass queue from Mailable to SendQueuedMailable job (#47612) * Pass queue from Mailable to SendQueuedMailable job Fixes issue where the unserialized job has the wrong queue. * Pass connection from Mailable to SendQueuedMailable job * Fix property mismatches in SendQueuedMailable * order --------- Co-authored-by: Taylor Otwell --- src/Illuminate/Mail/SendQueuedMailable.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Mail/SendQueuedMailable.php b/src/Illuminate/Mail/SendQueuedMailable.php index 7f2023221d8e..28a72c47c7de 100644 --- a/src/Illuminate/Mail/SendQueuedMailable.php +++ b/src/Illuminate/Mail/SendQueuedMailable.php @@ -56,11 +56,14 @@ class SendQueuedMailable public function __construct(MailableContract $mailable) { $this->mailable = $mailable; - $this->tries = property_exists($mailable, 'tries') ? $mailable->tries : null; - $this->timeout = property_exists($mailable, 'timeout') ? $mailable->timeout : null; - $this->maxExceptions = property_exists($mailable, 'maxExceptions') ? $mailable->maxExceptions : null; + $this->afterCommit = property_exists($mailable, 'afterCommit') ? $mailable->afterCommit : null; + $this->connection = property_exists($mailable, 'connection') ? $mailable->connection : null; + $this->maxExceptions = property_exists($mailable, 'maxExceptions') ? $mailable->maxExceptions : null; + $this->queue = property_exists($mailable, 'queue') ? $mailable->queue : null; $this->shouldBeEncrypted = $mailable instanceof ShouldBeEncrypted; + $this->timeout = property_exists($mailable, 'timeout') ? $mailable->timeout : null; + $this->tries = property_exists($mailable, 'tries') ? $mailable->tries : null; } /**