You are here

function theme_htmlmail in HTML Mail 5

Theme function to load htmlmail.tpl.php

1 theme call to theme_htmlmail()
htmlmail_mail_alter in ./htmlmail.module
Implementation of hook_mail_alter().

File

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

Code

function theme_htmlmail($body) {
  if (file_exists(path_to_theme() . '/htmlmail.tpl.php')) {
    $path = path_to_theme();
  }
  else {
    $path = drupal_get_path('module', 'htmlmail');
  }
  $template = $path . '/htmlmail.tpl.php';
  $variables = array(
    'body' => $body,
    'path' => url('', NULL, NULL, TRUE) . $path,
    'header' => variable_get('htmlmail_header', ''),
    'footer' => variable_get('htmlmail_footer', ''),
    'css' => variable_get('htmlmail_css', ''),
  );
  return _phptemplate_render($template, $variables);
}