You are here

function htmlmail_mail_alter in HTML Mail 5

Same name and namespace in other branches
  1. 6 htmlmail.module \htmlmail_mail_alter()

Implementation of hook_mail_alter().

File

./htmlmail.module, line 65
Send system emails in HTML

Code

function htmlmail_mail_alter($mailkey, &$recipient, &$subject, &$body, &$sender, &$headers) {
  $headers['Content-Type'] = 'text/html; charset="utf-8"';

  // The paragraph an break stuff
  if (variable_get('htmlmail_autop', '1') == 1) {
    $body = _filter_autop($body);
  }
  if (variable_get('htmlmail_urlfilter', '1') == 1) {

    // defaults to 72 as there is no filter 0 -- make filters a configuration option?
    $body = _filter_url($body, 0);
  }

  // Theme from template htmlmail.tpl.php
  $body = theme('htmlmail', $body);
  if (variable_get('htmlmail_emogrifier', '0') == 1) {
    $body = _htmlmail_emogrify($body);
  }
  return;
}