From c4d966c6a11626da124d258de8bcfa8240408b17 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 25 Mar 2009 21:56:25 +0000 Subject: [PATCH] BUGFIX Explicitly define customHeaders as an array, and ensure send()/sendPlain() both use customHeaders git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73654 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- email/Email.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/email/Email.php b/email/Email.php index 510bd2fd4..e9b9c5f1d 100755 --- a/email/Email.php +++ b/email/Email.php @@ -89,7 +89,7 @@ class Email extends ViewableData { /** * @param array $customHeaders A map of header-name -> header-value */ - protected $customHeaders; + protected $customHeaders = array(); /** * @param array $attachements Internal, use {@link attachFileFromString()} or {@link attachFile()} @@ -381,7 +381,9 @@ class Email extends ViewableData { if(empty($this->from)) $this->from = Email::getAdminEmail(); $this->setBounceHandlerURL($this->bounceHandlerURL); - + + $headers = $this->customHeaders; + $headers['X-SilverStripeBounceURL'] = $this->bounceHandlerURL; if($messageID) $headers['X-SilverStripeMessageID'] = project() . '.' . $messageID; @@ -432,7 +434,7 @@ class Email extends ViewableData { * @return bool Success of the sending operation from an MTA perspective. * Doesn't actually give any indication if the mail has been delivered to the recipient properly) */ - public function send( $messageID = null ) { + public function send($messageID = null) { Requirements::clear(); $this->parseVariables();