From 9ff0dde675b799da51bfe058e818486c8c05fc33 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 12 Mar 2008 04:19:39 +0000 Subject: [PATCH] $isPlain flag added to the parseVariables function git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50932 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Email.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/Email.php b/core/Email.php index 757f95844..ca4935301 100755 --- a/core/Email.php +++ b/core/Email.php @@ -161,8 +161,10 @@ class Email extends ViewableData { /** * Load all the template variables into the internal variables, including * the template into body. Called before send() or debugSend() + * $isPlain=true will cause the template to be ignored, otherwise the GenericEmail template will be used + * and it won't be plain email :) */ - protected function parseVariables() { + protected function parseVariables($isPlain = false) { if(!$this->parseVariables_done) { $this->parseVariables_done = true; @@ -176,7 +178,7 @@ class Email extends ViewableData { // Process a .SS template file $fullBody = $this->body; - if($this->ss_template) { + if($this->ss_template && !$isPlain) { // Requery data so that updated versions of To, From, Subject, etc are included $data = $this->templateData(); @@ -207,7 +209,7 @@ class Email extends ViewableData { Requirements::clear(); - $this->parseVariables(); + $this->parseVariables(true); if(empty($this->from)) $this->from = Email::getAdminEmail();