You are here

function template_preprocess_htmlmail in HTML Mail 7.2

Same name and namespace in other branches
  1. 8.3 htmlmail.module \template_preprocess_htmlmail()
  2. 8 htmlmail.module \template_preprocess_htmlmail()
  3. 8.2 htmlmail.module \template_preprocess_htmlmail()
  4. 6.2 htmlmail.module \template_preprocess_htmlmail()
  5. 6 htmlmail.module \template_preprocess_htmlmail()
  6. 7 htmlmail.module \template_preprocess_htmlmail()

Process variables to format email messages.

See also

htmlmail.tpl.php

File

./htmlmail.module, line 116
Sends system emails in HTML.

Code

function template_preprocess_htmlmail(array &$variables) {
  $variables['debug'] = variable_get('htmlmail_debug', '0');
  $variables['theme'] = htmlmail_get_selected_theme($variables);
  $variables['module_path'] = drupal_get_path('module', 'htmlmail');
  if (empty($variables['theme'])) {
    $variables['theme'] = 'no theme';
    $variables['theme_path'] = $variables['module_path'];
  }
  else {
    $variables['theme_path'] = drupal_get_path('theme', $variables['theme']);
  }
  global $base_url;
  $variables['theme_url'] = $base_url . base_path() . $variables['theme_path'];
  $variables['message_id'] = $variables['module'] . '_' . $variables['key'];
  $suggestion = 'htmlmail__' . $variables['module'];
  $variables['theme_hook_suggestions'][] = $suggestion;
  $suggestion .= '__' . $variables['key'];
  $variables['theme_hook_suggestions'][] = $suggestion;
}