HTML Mail

HTML Mail lets you theme your outgoing messages the same way you theme the rest of your website.

Requirements

Installation

Install as usual.

The following additional modules, while not required, are highly recommended:

Configuration

Visit the Mail System settings page at admin/config/system/mailsystem to select which parts of Drupal will use HTML Mail instead of the default mail system.

Visit the HTML Mail settings page at admin/config/system/htmlmail to select a theme, pre-filter, and post-filter for your messages.

Theming

The email message text goes through four transformations before sending:

  1. The Text format pre-filter from the module settings page is applied. This should be the same text format that your website uses for contributed content such as comments or blog postings. For consistency and security, it should include the the Correct faulty and chopped off HTML from filter.module, or a better replacement such as HTML Purifier or htmLawed.

  2. A theme template is applied. The default template is the included htmlmail.tpl.php file. You may copy this file to your theme directory and use it to customize the contents and formatting of your messages. The comments within the file contain complete documentation on its usage.

  3. The message may be wrapped in a website theme selected on the module settings page. Creating an email-specific sub-theme lets you use the full power of the drupal theme system to format your messages.

  4. The Text format post-filter from the module settings page is applied. For best results, this should be an email-specific input format containing the following text format filters:

Troubleshooting

Visit the issue queue for support -and feature requests.

Related Modules

Emogrifier

http://drupal.org/project/emogrifier

HTML Purifier

http://drupal.org/project/htmlpurifier

htmLawed

http://drupal.org/project/htmlawed

Mail MIME

http://drupal.org/project/mailmime

Mail System

http://drupal.org/project/mailsystem

Pathologic

http://drupal.org/project/pathologic

Transliteration

http://drupal.org/project/transliteration

Documentation

filter.module
D6: http://api.drupal.org/api/drupal/modules--filter--filter.module/6
D7: http://api.drupal.org/api/drupal/modules--filter--filter.module/7

D7: http://api.drupal.org/api/drupal/modules--filter--filter.module/group/standard_filters/7

Installing contributed modules
D6: http://drupal.org/documentation/install/modules-themes/modules-5-6

D7: http://drupal.org/documentation/install/modules-themes/modules-7

Theming guide

http://drupal.org/documentation/theme

Original Author

Current Maintainer