Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email::render() generates DBHTMLFragment instead of string for plain-text part of email #9069

Closed
kinglozzer opened this issue Jun 14, 2019 · 0 comments

Comments

@kinglozzer
Copy link
Member

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.

Affected Version

4.4.1, probably earlier

Description

// Render plain part
if ($plainTemplate && !$plainPart) {
$plainPart = $this->renderWith($plainTemplate, $this->getData());
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant