mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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).
This commit is contained in:
parent
1ad2d6535e
commit
27ac001d5b
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user