function template_preprocess_htmlmail in HTML Mail 6.2
Same name and namespace in other branches
- 8.3 htmlmail.module \template_preprocess_htmlmail()
- 8 htmlmail.module \template_preprocess_htmlmail()
- 8.2 htmlmail.module \template_preprocess_htmlmail()
- 6 htmlmail.module \template_preprocess_htmlmail()
- 7.2 htmlmail.module \template_preprocess_htmlmail()
- 7 htmlmail.module \template_preprocess_htmlmail()
Process variables to format email messages.
See also
File
- ./
htmlmail.module, line 102 - Sends system emails in HTML.
Code
function template_preprocess_htmlmail(array &$variables) {
$message = $variables['message'];
$variables += $message;
$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']);
}
$variables['theme_url'] = url($variables['theme_path'], array(
'absolute' => TRUE,
));
$variables['message_id'] = $variables['module'] . '_' . $variables['key'];
$template = 'htmlmail-' . str_replace('_', '-', $variables['module']);
$variables['template_files'][] = $template;
$template = 'htmlmail-' . str_replace('_', '-', $variables['message_id']);
$variables['template_files'][] = $template;
}