mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR fixed PHP notice when Email::send_all_emails_to() and Email::cc_all_emails_to() are used at the same time
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@58023 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9bf204d8f1
commit
a5037b82d5
@ -321,12 +321,19 @@ class Email extends ViewableData {
|
||||
}
|
||||
|
||||
if(self::$cc_all_emails_to) {
|
||||
if(trim($headers['Cc'])) $headers['Cc'] .= ', ';
|
||||
$headers['Cc'] .= self::$cc_all_emails_to;
|
||||
if(!empty($headers['Cc']) && trim($headers['Cc'])) {
|
||||
$headers['Cc'] .= ', ' . self::$cc_all_emails_to;
|
||||
} else {
|
||||
$headers['Cc'] = self::$cc_all_emails_to;
|
||||
}
|
||||
}
|
||||
|
||||
if(self::$bcc_all_emails_to) {
|
||||
if(trim($headers['Bcc'])) $headers['Bcc'] .= ', ';
|
||||
$headers['Bcc'] .= self::$bcc_all_emails_to;
|
||||
if(!empty($headers['Bcc']) && trim($headers['Bcc'])) {
|
||||
$headers['Bcc'] .= ', ' . self::$bcc_all_emails_to;
|
||||
} else {
|
||||
$headers['Cc'] = self::$bcc_all_emails_to;
|
||||
}
|
||||
}
|
||||
|
||||
return self::mailer()->sendHTML($to, $this->from, $subject, $this->body, $this->attachments, $headers, $this->plaintext_body);
|
||||
|
Loading…
Reference in New Issue
Block a user