-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Adjusted TransportBuilder prepareMessage method to support text/plain… #26474
Adjusted TransportBuilder prepareMessage method to support text/plain… #26474
Conversation
Hi @twoonesixdigital. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
$mimePart = $this->mimePartInterfaceFactory->create( | ||
[ | ||
'content' => $content, | ||
'type' => $part['type'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the variable name is not coming from you but it looks like that $part is never defined as an array prior. Since it only uses type maybe it makes sense to rename $part['type']
to $partType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree. I suspect usage of the $part array is probably an artifact of an older version of the class. Replacing that with something simpler and less ambiguous would likely reduce confusion.
The internal Magento team is working on this issue right now. |
Hi @twoonesixdigital, thank you for your contribution! |
Description (*)
As of 2.3.3, Magento's Magento\Framework\Mail\Template\TransportBuilder class can no longer send emails whose "Content-Type" header is set to "text/plain". This is because the TransportBuilder's prepareMessage method does not pass the determined template type to the mimePartInterfaceFactory's create method. When no "type" key is present in the array passed to the create method, the mimePartInterfaceFactory defaults to "text/html".
This pull request simply modifies the prepareMessage method so that it passes the previously determined template type to the mimePartInterfaceFactory's create method.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)