includes/functions/functions_email.php
line 209 starts with:
PHP Code:
function zen_build_html_email_from_template($module='default',$block) {
// Identify and Read the template file for the type of message being sent
$template_filename_base = DIR_FS_EMAIL_TEMPLATES . "email_template_";
if (file_exists($template_filename_base . str_replace(array('_extra','_admin'),'',$module) . '.html')) {
$template_filename = $template_filename_base . str_replace(array('_extra','_admin'),'',$module) . '.html';
} elseif (file_exists($template_filename_base . 'default' . '.html')) {
$template_filename = $template_filename_base . 'default' . '.html';
} else {
echo 'ERROR: The email template file for '.$template_filename_base.' or '.$template_filename.' cannot be found.';
return ''; // couldn't find template file, so return an empty string for html message.
}
Try replacing that with:
PHP Code:
function zen_build_html_email_from_template($module='default',$block) {
global $messageStack;
// Identify and Read the template file for the type of message being sent
$template_filename_base = DIR_FS_EMAIL_TEMPLATES . "email_template_";
$template_filename = DIR_FS_EMAIL_TEMPLATES . "email_template_" . $current_page_base . ".html";
if (!file_exists($template_filename)) {
if (file_exists($template_filename_base . str_replace(array('_extra','_admin'),'',$module) . '.html')) {
$template_filename = $template_filename_base . str_replace(array('_extra','_admin'),'',$module) . '.html';
} elseif (file_exists($template_filename_base . 'default' . '.html')) {
$template_filename = $template_filename_base . 'default' . '.html';
} else {
$messageStack->add('header','ERROR: The email template file for ('.$template_filename_base.') or ('.$template_filename.') cannot be found.','caution');
return ''; // couldn't find template file, so return an empty string for html message.
}
}