Merge pull request #8323 from lekoala/patch-11

email rendering should not include requirements
This commit is contained in:
Robbie Averill 2018-08-23 15:10:41 +12:00 committed by GitHub
commit c459130986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -790,6 +790,9 @@ class Email extends ViewableData
return $this; return $this;
} }
// Do not interfere with emails styles
Requirements::clear();
// Render plain part // Render plain part
if ($plainTemplate && !$plainPart) { if ($plainTemplate && !$plainPart) {
$plainPart = $this->renderWith($plainTemplate, $this->getData()); $plainPart = $this->renderWith($plainTemplate, $this->getData());
@ -807,6 +810,9 @@ class Email extends ViewableData
$plainPart = $htmlPartObject->Plain(); $plainPart = $htmlPartObject->Plain();
} }
// Rendering is finished
Requirements::restore();
// Fail if no email to send // Fail if no email to send
if (!$plainPart && !$htmlPart) { if (!$plainPart && !$htmlPart) {
return $this; return $this;