mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Make sure plain parts are rendered when re-rendering emails
This commit is contained in:
parent
6d8df46b8a
commit
6139de8680
@ -621,6 +621,12 @@ class Email extends ViewableData
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$plainPart = $this->findPlainPart();
|
||||
if ($plainPart) {
|
||||
$this->getSwiftMessage()->detach($plainPart);
|
||||
}
|
||||
unset($plainPart);
|
||||
|
||||
$body = HTTP::absoluteURLs($body);
|
||||
$this->getSwiftMessage()->setBody($body);
|
||||
|
||||
@ -856,6 +862,12 @@ class Email extends ViewableData
|
||||
*/
|
||||
public function generatePlainPartFromBody()
|
||||
{
|
||||
$plainPart = $this->findPlainPart();
|
||||
if ($plainPart) {
|
||||
$this->getSwiftMessage()->detach($plainPart);
|
||||
}
|
||||
unset($plainPart);
|
||||
|
||||
$this->getSwiftMessage()->addPart(
|
||||
Convert::xml2raw($this->getBody()),
|
||||
'text/plain',
|
||||
|
Loading…
x
Reference in New Issue
Block a user