From 8e87264864cddefd6718351286dcd3723795fc7e Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Fri, 14 Jun 2019 11:39:47 +0100 Subject: [PATCH] FIX: Email::render() generating object instead of string for plaintext part (fixes #9069) --- src/Control/Email/Email.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Control/Email/Email.php b/src/Control/Email/Email.php index 8d79db7097e..c343fade478 100644 --- a/src/Control/Email/Email.php +++ b/src/Control/Email/Email.php @@ -792,10 +792,10 @@ public function render($plainOnly = false) // 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 @@ public function render($plainOnly = false) $htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart); $plainPart = $htmlPartObject->Plain(); } - + // Rendering is finished Requirements::restore();