Skip to content

Commit 3cd6efd

Browse files
committed
wip
1 parent 5007141 commit 3cd6efd

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/Jobs/ResendMailJob.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,21 @@ private function setMessageContent(Message $message): self
5656
private function setMessageRecipients(Message $message): self
5757
{
5858
$message->subject($this->mail->subject ?? '')
59-
->from($this->getFirstAddress($this->mail->from))
59+
->from(array_keys($this->mail->from)[0], array_values($this->mail->from)[0])
6060
->to($this->to);
6161

62-
if ($this->mail->cc || $this->cc) {
62+
if ($this->mail->cc || count($this->cc) > 0) {
6363
$message->cc($this->mail->cc ?? $this->cc);
6464
}
6565

66-
if ($this->mail->bcc || $this->bcc) {
66+
if ($this->mail->bcc || count($this->bcc) > 0) {
6767
$message->bcc($this->mail->bcc ?? $this->bcc);
6868
}
6969

7070
if ($this->mail->reply_to || $this->replyTo) {
71-
$message->replyTo($this->getFirstAddress($this->mail->reply_to ?? $this->replyTo));
71+
$message->replyTo($this->mail->reply_to ?? $this->replyTo);
7272
}
7373

7474
return $this;
7575
}
76-
77-
private function getFirstAddress(string $jsonAddresses): string
78-
{
79-
$addresses = json_decode($jsonAddresses, true);
80-
81-
return array_key_first($addresses);
82-
}
8376
}

0 commit comments

Comments
 (0)