You are here

function template_preprocess_htmlmail in HTML Mail 6

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. 7.2 htmlmail.module \template_preprocess_htmlmail()
  6. 7 htmlmail.module \template_preprocess_htmlmail()

Process variables to format e-mail.

See also

htmlmail.tpl.php

File

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

Code

function template_preprocess_htmlmail(&$variables) {
  $variables['path'] = url($variables['directory'], array(
    'absolute' => TRUE,
  ));
  if (module_exists('token') && variable_get('htmlmail_token', '0')) {
    global $user;
    $types = array(
      'user' => $user,
      'profile' => $user,
    );
    $variables['header'] = token_replace_multiple(variable_get('htmlmail_header', ''), $types);
    $variables['footer'] = token_replace_multiple(variable_get('htmlmail_footer', ''), $types);
  }
  else {
    $variables['header'] = variable_get('htmlmail_header', '');
    $variables['footer'] = variable_get('htmlmail_footer', '');
  }
  $variables['css'] = variable_get('htmlmail_css', '');
  $module = preg_replace('/_.*$/', '', $variables['key']);
  $variables['template_files'][] = 'htmlmail-' . $module;
  $variables['template_files'][] = 'htmlmail-' . $variables['key'];
}