Support HTML emails from mimemail

Created on 2 October 2023, over 1 year ago
Updated 12 October 2023, over 1 year ago

Problem/Motivation

On one site we use MIMEMail to format emails as HTML. When these emails are rerouted using reroute_email the prefix does not have any line wrappings added, so the message looks bad.

For example, imagine this email:

Maecenas faucibus mollis interdum.

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean lacinia bibendum nulla sed consectetur. Nullam id dolor id nibh ultricies vehicula ut id elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

When it is rewrouted it ends up looking like this:

This email was rerouted. Web site: SITENAME Mail key: SOMETHING Originally to person@example.com ----------------------- Maecenas faucibus mollis interdum.

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean lacinia bibendum nulla sed consectetur. Nullam id dolor id nibh ultricies vehicula ut id elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Steps to reproduce

Install MIMEMail and configure emails to be delivered as HTML.
Install Reroute Email.
Send an email that's in HTML format.

Proposed resolution

When HTML emails are rerouted the prefix added needs to have line wrapping.

Remaining tasks

Work out how to fix the problem.
Fix the problem.

User interface changes

The prefix added to HTML-formatted emails does not make the email hard to read.

API changes

TBD

Data model changes

TBD

πŸ’¬ Support request
Status

Fixed

Version

2.3

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DamienMcKenna
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine bohart Lutsk, Ukraine

    There are 3 levels of emailing in Drupal:
    - email build (this module alter it);
    - email format (`mimemail` module, reroute_email module isn't aware of the formatting);
    - email send.

    If `mimemail` module is used, we can find UI to configure email build/format on `mailsystem` (required by `mimemail`) configuration page:
    `/admin/config/system/mailsystem`

    Rerouting is implemented on the email build level (`hook_mail_alter`) and on this stage we have no information about the email formatting (it can be configured in different ways for each email).

    There is `Email format` setting in `mimemail` configuration form (`/admin/config/system/mimemail`), which says:
    > If you are using Mime Mail as default mail system, make sure to enable "Convert line breaks into HTML".

    Once we add `Convert line breaks into HTML` filter to the configured `Email format` (`/admin/config/content/formats`), everything works as expected.

    In other words, while using `mimemail` module as email formatted, it (email formatting) should be configured via it.

    I have installed:
    - new Drupal 10 instance + mimemail + reroute_email;
    - add `Convert line breaks into HTML` filter to `Email format` used by `mimemail`;
    - sent a test email via test form (`admin/config/development/reroute_email/test`);
    - sent a core email by resetting the password (`/user/password`);
    Both emails look correct.

    At this moment, it looks like there is nothing to change in this module.
    Let me know if this message helps!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024