Problem/Motivation
If you use phpmailer_smtp as formatter (enabling HTML email format) and you configure a webform to send two emails, the second one will be generated with a nested multi-part content which breaks the rendering. Using the old Mime Mail module everything works as expected.
Steps to reproduce
- Enable webform
- Enable phpmailer_smtp
- Configure a webform with two notification emails. Both with "Send email as HTML" enabled.
- Submit a webform: the first email will be correctly sent, the second one will not.
Email example:
Here is an example of wrongly generated email (the second email sent by webform using phpmailer_smtp html formatter). I've skipped the email header which is fine.
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="b1_qCeTsAcsomiFvZxK1BQHgClHhdEY3ZC0bCaYTpi8A"
--b1_qCeTsAcsomiFvZxK1BQHgClHhdEY3ZC0bCaYTpi8A
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8Bit
PLAIN_TEXT_CONTENT
--b1_qCeTsAcsomiFvZxK1BQHgClHhdEY3ZC0bCaYTpi8A
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8Bit
This is a multi-part message in MIME format.
--b1_GhacZBcxRpcyNoMsvHfBqa3IIApNHz2yh1GkrwG3cY
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
PLAIN_TEXT_CONTENT
--b1_GhacZBcxRpcyNoMsvHfBqa3IIApNHz2yh1GkrwG3cY
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
HTML_TEXT_CONTENT
--b1_GhacZBcxRpcyNoMsvHfBqa3IIApNHz2yh1GkrwG3cY--
--b1_qCeTsAcsomiFvZxK1BQHgClHhdEY3ZC0bCaYTpi8A--
As you can see, inside the text/html section, there is again a section with text/plain content which is wrong because it's already available.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3324504-3.patch | 1017 bytes | imclean |
Comments
Comment #2
imclean commentedThanks for the detailed report, I'll look into it. I'd categorise this as major.
Comment #3
imclean commentedJust needed a slight refactoring. Please review.
Comment #4
finex commentedHi, the patch works fine. I've tested on a couple of different websites and it works as expected. Thank you very much @imclean.
Comment #6
imclean commentedComment #7
imclean commentedThanks. This has been included in 2.2.0-alpha3.