mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
$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
This commit is contained in:
parent
b946ee9bb0
commit
9ff0dde675
@ -161,8 +161,10 @@ class Email extends ViewableData {
|
|||||||
/**
|
/**
|
||||||
* Load all the template variables into the internal variables, including
|
* Load all the template variables into the internal variables, including
|
||||||
* the template into body. Called before send() or debugSend()
|
* 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) {
|
if(!$this->parseVariables_done) {
|
||||||
$this->parseVariables_done = true;
|
$this->parseVariables_done = true;
|
||||||
|
|
||||||
@ -176,7 +178,7 @@ class Email extends ViewableData {
|
|||||||
|
|
||||||
// Process a .SS template file
|
// Process a .SS template file
|
||||||
$fullBody = $this->body;
|
$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
|
// Requery data so that updated versions of To, From, Subject, etc are included
|
||||||
$data = $this->templateData();
|
$data = $this->templateData();
|
||||||
|
|
||||||
@ -207,7 +209,7 @@ class Email extends ViewableData {
|
|||||||
|
|
||||||
Requirements::clear();
|
Requirements::clear();
|
||||||
|
|
||||||
$this->parseVariables();
|
$this->parseVariables(true);
|
||||||
|
|
||||||
if(empty($this->from)) $this->from = Email::getAdminEmail();
|
if(empty($this->from)) $this->from = Email::getAdminEmail();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user