Merge pull request #9070 from kinglozzer/email-plaintext

FIX: Email::render() generating object instead of string for plaintext part (fixes #9069)
This commit is contained in:
Robbie Averill 2019-07-02 18:47:18 +12:00 committed by GitHub
commit ad050997fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -792,10 +792,10 @@ class Email extends ViewableData
// Do not interfere with emails styles
Requirements::clear();
// Render plain part
if ($plainTemplate && !$plainPart) {
$plainPart = $this->renderWith($plainTemplate, $this->getData());
$plainPart = $this->renderWith($plainTemplate, $this->getData())->Plain();
}
// Render HTML part, either if sending html email, or a plain part is lacking
@ -809,7 +809,7 @@ class Email extends ViewableData
$htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart);
$plainPart = $htmlPartObject->Plain();
}
// Rendering is finished
Requirements::restore();