Skip to content
Permalink
Browse files

FIX email rendering should not include requirements

If no body is defined, the email is rendered according to a template. Clearing requirements prevent unnecessary styles/scripts to be included in the html (and that needs to be processed/stripped down the line).
  • Loading branch information...
lekoala authored and robbieaverill committed Aug 14, 2018
1 parent 1ad2d65 commit 27ac001d5b27cce4f80ce4b3335c14708b116830
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Control/Email/Email.php
@@ -790,6 +790,9 @@ public function render($plainOnly = false)
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 @@ public function render($plainOnly = false)
$htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart);
$plainPart = $htmlPartObject->Plain();
}
// Rendering is finished
Requirements::restore();
// Fail if no email to send
if (!$plainPart && !$htmlPart) {

0 comments on commit 27ac001

Please sign in to comment.
You can’t perform that action at this time.