You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you specify a template for the plain-text part of an email, Email::render() generates a DBHTMLFragment instance instead of a string for that part.
This generates a DBHTMLFragment object, which is then passed to the Swift message via $this->getSwiftMessage()->addPart($plainPart, 'text/plain', 'utf-8');. addPart() is documented as accepting string|Swift_OutputByteStream, which DBHTMLFragment isn’t.
For the Postmark driver, this results in an empty plain-text part which means that the email is discarded by their API.
Just tacking ->Plain() on the end fixes it
The text was updated successfully, but these errors were encountered:
When you specify a template for the plain-text part of an email,
Email::render()
generates aDBHTMLFragment
instance instead of a string for that part.Affected Version
4.4.1, probably earlier
Description
silverstripe-framework/src/Control/Email/Email.php
Lines 796 to 799 in e1afcf7
This generates a
DBHTMLFragment
object, which is then passed to the Swift message via$this->getSwiftMessage()->addPart($plainPart, 'text/plain', 'utf-8');
.addPart()
is documented as acceptingstring|Swift_OutputByteStream
, whichDBHTMLFragment
isn’t.For the Postmark driver, this results in an empty plain-text part which means that the email is discarded by their API.
Just tacking
->Plain()
on the end fixes itThe text was updated successfully, but these errors were encountered: