I send HTML mail using the Mime Mail module on my multilingual site.

To get HTML to properly be rendered in the privatemsg email body, I had to make the following change:

function pm_email_notify_text($key, $language = NULL) {
  $text = _pm_email_notify_source_text($key);

  $function = 'i18n_string_translate';
  if (function_exists($function)) {
    $translated = $function('pm_email_notify:mail:mail:' . $key, $text, array('langcode' => isset($language) ? $language->language : NULL));
    return $translated;
  }
  return $text;
}

to:

$translated = $function('pm_email_notify:mail:mail:' . $key, $text, array('langcode' => isset($language) ? $language->language : NULL, 'format' => 'full_html'));

I'll try to put a patch together later but I wanted to make a quick note of it for now.

Comments

ivnish’s picture

Status: Active » Closed (outdated)