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
This commit is contained in:
Sean Harvey 2009-03-25 21:56:25 +00:00
parent 2f2910eac3
commit c4d966c6a1

View File

@ -89,7 +89,7 @@ class Email extends ViewableData {
/** /**
* @param array $customHeaders A map of header-name -> header-value * @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()} * @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(); if(empty($this->from)) $this->from = Email::getAdminEmail();
$this->setBounceHandlerURL($this->bounceHandlerURL); $this->setBounceHandlerURL($this->bounceHandlerURL);
$headers = $this->customHeaders;
$headers['X-SilverStripeBounceURL'] = $this->bounceHandlerURL; $headers['X-SilverStripeBounceURL'] = $this->bounceHandlerURL;
if($messageID) $headers['X-SilverStripeMessageID'] = project() . '.' . $messageID; 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. * @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) * 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(); Requirements::clear();
$this->parseVariables(); $this->parseVariables();