mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 13:19:11 +02: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)
|
public function setBody($body)
|
||||||
{
|
{
|
||||||
|
$plainPart = $this->findPlainPart();
|
||||||
|
if ($plainPart) {
|
||||||
|
$this->getSwiftMessage()->detach($plainPart);
|
||||||
|
}
|
||||||
|
unset($plainPart);
|
||||||
|
|
||||||
$body = HTTP::absoluteURLs($body);
|
$body = HTTP::absoluteURLs($body);
|
||||||
$this->getSwiftMessage()->setBody($body);
|
$this->getSwiftMessage()->setBody($body);
|
||||||
|
|
||||||
@ -856,6 +862,12 @@ class Email extends ViewableData
|
|||||||
*/
|
*/
|
||||||
public function generatePlainPartFromBody()
|
public function generatePlainPartFromBody()
|
||||||
{
|
{
|
||||||
|
$plainPart = $this->findPlainPart();
|
||||||
|
if ($plainPart) {
|
||||||
|
$this->getSwiftMessage()->detach($plainPart);
|
||||||
|
}
|
||||||
|
unset($plainPart);
|
||||||
|
|
||||||
$this->getSwiftMessage()->addPart(
|
$this->getSwiftMessage()->addPart(
|
||||||
Convert::xml2raw($this->getBody()),
|
Convert::xml2raw($this->getBody()),
|
||||||
'text/plain',
|
'text/plain',
|
||||||
|
Loading…
Reference in New Issue
Block a user