- Default value of bcc if nothing was provided
This commit is contained in:
parent
b284b67d91
commit
fe6fdd3987
|
@ -73,12 +73,12 @@ class SymfonyMailer implements MailerInterface
|
|||
|
||||
protected function cc() : array
|
||||
{
|
||||
return $this->arrayToAddress($this->cc);
|
||||
return $this->arrayToAddress($this->cc ?? []);
|
||||
}
|
||||
|
||||
protected function bcc() : array
|
||||
{
|
||||
return $this->arrayToAddress($this->bcc);
|
||||
return $this->arrayToAddress($this->bcc ?? []);
|
||||
}
|
||||
|
||||
protected function arrayToAddress(string|\Stringable|array $array) : array
|
||||
|
@ -86,8 +86,13 @@ class SymfonyMailer implements MailerInterface
|
|||
$list = [];
|
||||
|
||||
foreach((array) $array as $addr => $name) {
|
||||
if (is_numeric($addr)) {
|
||||
$list[] = $name;
|
||||
}
|
||||
else {
|
||||
$list[] = "$name <$addr>";
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue