mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8323 from lekoala/patch-11
email rendering should not include requirements
This commit is contained in:
commit
c459130986
@ -790,6 +790,9 @@ class Email extends ViewableData
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Do not interfere with emails styles
|
||||
Requirements::clear();
|
||||
|
||||
// Render plain part
|
||||
if ($plainTemplate && !$plainPart) {
|
||||
$plainPart = $this->renderWith($plainTemplate, $this->getData());
|
||||
@ -806,6 +809,9 @@ class Email extends ViewableData
|
||||
$htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart);
|
||||
$plainPart = $htmlPartObject->Plain();
|
||||
}
|
||||
|
||||
// Rendering is finished
|
||||
Requirements::restore();
|
||||
|
||||
// Fail if no email to send
|
||||
if (!$plainPart && !$htmlPart) {
|
||||
|
Loading…
Reference in New Issue
Block a user