1. edit /includes/functions/functions_email.php
around line 329, find this section. Add the additional code as shown:
Code:
if (!file_exists($template_filename)) {
if (isset($block['EMAIL_TEMPLATE_FILENAME']) && file_exists($template_filename_base . $block['EMAIL_TEMPLATE_FILENAME'] . '.html')) {
$template_filename = $template_filename_base . $block['EMAIL_TEMPLATE_FILENAME'] . '.html';
} elseif (file_exists($template_filename_base . str_replace(array('_extra','_admin'),'',$module) . '.html')) {
2. /admin/includes/modules/newsletter.php
around line 99, find this section. Add the new line, as shown:
Code:
$html_msg['EMAIL_FIRST_NAME'] = $audience->fields['customers_firstname'];
$html_msg['EMAIL_LAST_NAME'] = $audience->fields['customers_lastname'];
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
$html_msg['EMAIL_TEMPLATE_FILENAME'] = $whatever_filename_you_specify_here;
zen_mail($audience->fields['customers_firstname'] . ' ' . $audience->fields['customers_lastname'], $audience->fields['customers_email_address'], $this->title, $this->content, STORE_NAME, EMAIL_FROM, $html_msg, 'newsletters');
3. Now make whatever additional code edits (to the newsletters.php file) would be required to get the $html_msg['EMAIL_TEMPLATE_FILENAME'] variable to contain the name of the template you want loaded.
The way it's coded above, it'll expect files named like this:
/email/email_template_*******.html
... where ******* is the name you get inserted into the $html_msg['EMAIL_TEMPLATE_FILENAME'] variable.
Since you've made some code edits to allow you to select groups, perhaps you can link a text string with those groups which could be used as the filename piece.
4. repeat #2 & #3 for the product_notifications module file if necessary.
Bookmarks