Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
Trying to send emails using MimeMail and there is an issue whereby the body value is sent as a single value to elasticEmailSend() if it's plain OR HTML, meaning that the value contains both the plain text and HTML value concatenated.
Ideally we can use drupal_html_to_text() to generate a plain text value of the HTML output? Then pass both values through to elasticEmailSend().
Essentially this is the same issue as per this Mandrill issue - https://www.drupal.org/node/1863988.
Thanks,
Luke
Comments
Comment #2
mike.davis CreditAttribution: mike.davis at Deeson commentedHere is a patch which sets the text version of a HTML email using drupal_html_to_text()
Comment #3
mike.davis CreditAttribution: mike.davis at Deeson commentedHere is an updated patch provided by @luketsimmons which adds support for theming a HTML email template for your site when using something like Mimemail.
Comment #4
mike.davis CreditAttribution: mike.davis at Deeson commentedAlthough this works, having had a play with it it defaults to always sending using the HTML template.
A setting should be added to the admin settings which enables an admin to decide if the site is going to use plain text or HTML emails, and/ or if the email that is being sent is HTML needs to be determined to then decide if to use the template or send as plain text?
Comment #5
mike.davis CreditAttribution: mike.davis at Deeson commentedComment #6
mike.davis CreditAttribution: mike.davis at Deeson commented