From 8c5eb9bcc6cc8f81267f3c390c6906051b011093 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 19 May 2009 23:23:45 +0000 Subject: [PATCH] BUGFIX #3788 Default values are overwritten in Email constructor (rjmackay) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77273 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- email/Email.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/email/Email.php b/email/Email.php index 1a5bce900..b86e24344 100755 --- a/email/Email.php +++ b/email/Email.php @@ -142,13 +142,13 @@ class Email extends ViewableData { * Create a new email. */ public function __construct($from = null, $to = null, $subject = null, $body = null, $bounceHandlerURL = null, $cc = null, $bcc = null) { - $this->from = $from; - $this->to = $to; - $this->subject = $subject; - $this->body = $body; - $this->cc = $cc; - $this->bcc = $bcc; - $this->setBounceHandlerURL($bounceHandlerURL); + if($from != null) $this->from = $from; + if($to != null) $this->to = $to; + if($subject != null) $this->subject = $subject; + if($body != null) $this->body = $body; + if($cc != null) $this->cc = $cc; + if($bcc != null) $this->bcc = $bcc; + if($bounceHandlerURL != null) $this->setBounceHandlerURL($bounceHandlerURL); } public function attachFileFromString($data, $filename, $mimetype = null) {