- 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
|
protected function cc() : array
|
||||||
{
|
{
|
||||||
return $this->arrayToAddress($this->cc);
|
return $this->arrayToAddress($this->cc ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function bcc() : array
|
protected function bcc() : array
|
||||||
{
|
{
|
||||||
return $this->arrayToAddress($this->bcc);
|
return $this->arrayToAddress($this->bcc ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function arrayToAddress(string|\Stringable|array $array) : array
|
protected function arrayToAddress(string|\Stringable|array $array) : array
|
||||||
|
@ -86,7 +86,12 @@ class SymfonyMailer implements MailerInterface
|
||||||
$list = [];
|
$list = [];
|
||||||
|
|
||||||
foreach((array) $array as $addr => $name) {
|
foreach((array) $array as $addr => $name) {
|
||||||
$list[] = "$name <$addr>";
|
if (is_numeric($addr)) {
|
||||||
|
$list[] = $name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$list[] = "$name <$addr>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
|
|
Loading…
Reference in New Issue