We needed a simple and consistent way to bypass the htmlmail (and just send default plain text email). By wrapping the alter hook code, and checking for a variable $message['no_htmlmail'] we make it possible to skip htmlmail if the $message['no_htmlmail']) parameter is set in any email template.

function htmlmail_mail_alter(&$message) {
  // Skip htmlmail if no_htmlmail property is set
  if (!isset($message['no_htmlmail'])) {
    [original code goes here]
  }
}

This will not have any effect on existing installations, so please consider the solution and add it to the module if you think it's a nice feature...

Comments

sifuhall’s picture

I would like to see this added as well.

jboeger’s picture

The htmlmail module has been working great for notifications, but suddenly it's breaking the Contact module (simple contact sends.)

How do I implement the code above? What goes in: [original code goes here]
from the code above?

I just need to override for the contact module. Thanks if you can help!!

pillarsdotnet’s picture

Status: Active » Postponed

This feature is available in the 7.x version. Will consider backporting to 6.x.

pillarsdotnet’s picture

Version: 6.x-1.3 » 6.x-2.3
Status: Postponed » Closed (fixed)

The 6.x-2.x branch is now stable. I'm therefore closing all open 6.x-1.x issues.

Re-open if there is some reason that 6.x-2.x doesn't work for you.