Skip to content

Commit 6767087

Browse files
committed
Fixes the issue: "An address can be an instance of Address or a string ("null" given)."
This issue happens due to CC and BCC being set to an empty array, which as of laravel 10+, cannot happen. Preventing the entire laravel plugin from sending any emails.
1 parent 48653be commit 6767087

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Traits/Replyable.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,17 @@ private function getMessageBody()
405405
$this->symfonyEmail
406406
->from($this->fromAddress())
407407
->to($this->toAddress())
408-
->cc($this->returnCopies($this->cc))
409-
->bcc($this->returnCopies($this->bcc))
410408
->subject($this->subject)
411409
->html($this->message)
412410
->priority($this->priority);
411+
412+
// Fixes the issue: "An address can be an instance of Address or a string ("null" given)."
413+
if(isset($this->cc)){
414+
$this->symfonyEmail->cc($this->returnCopies($this->cc));
415+
}
416+
if(isset($this->bcc)){
417+
$this->symfonyEmail->bcc($this->returnCopies($this->bcc));
418+
}
413419

414420
foreach ($this->attachments as $file) {
415421
$this->symfonyEmail->attachFromPath($file);

0 commit comments

Comments
 (0)