Zen Follower
- Join Date:
- Feb 2005
- Location:
- Captain Cook, Hawaii
- Posts:
- 172
- Plugin Contributions:
- 0
Disabling Customers Email
I would like to suggest that the solution I offered a few years ago, be incorporated as a permanet solution for disabling a customers email. The problem was discussed here: http://www.zen-cart.com/forum/showthread.php?t=42074
There are times when a customer has asked to be removed from all emails. My solution changes one core file (admin/customer.php) to add a bit of code. This mod just allows the Admin to set a third value (already coded but not used).
By allowing the Admin to set the value, we keep the customer record, purchases and reviews intact, but stop all emails.
Since Admin does not allow overrides, I currently have to remember to upload this patch to every site every update.
It looks like this was planned and not installed yet.
There may be a cleaner coding, but this works as is.
In admin/includes/languages/english
I see:
define('ENTRY_EMAIL_HTML_DISPLAY','HTML');
define('ENTRY_EMAIL_TEXT_DISPLAY','TEXT-Only');
define('ENTRY_EMAIL_NONE_DISPLAY','Never');
All I did was go to admin/customers.php and change the following: around line 790
Change this
} else {
$email_pref_text = ($cInfo->customers_email_format == 'TEXT') ? true : false;
$email_pref_html = !$email_pref_text;
echo zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . ' ' . ENTRY_EMAIL_HTML_DISPLAY . ' ' . zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . ' ' . ENTRY_EMAIL_TEXT_DISPLAY ;
}
to this
} else {
$email_pref_html = false;
$email_pref_text = false;
$email_pref_none = false;
switch ($cInfo->customers_email_format) {
case 'HTML':
$email_pref_html = true;
break;
case 'TEXT':
$email_pref_text = true;
break;
case 'NONE':
$email_pref_none = true;
break;
default:
echo 'ERROR: email format selection error.';
break;
}
echo zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . ' ' .
ENTRY_EMAIL_HTML_DISPLAY . ' ' .
zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . ' ' .
ENTRY_EMAIL_TEXT_DISPLAY . ' ' .
zen_draw_radio_field('customers_email_format', 'NONE', $email_pref_none) . ' ' .
ENTRY_EMAIL_NONE_DISPLAY ;
}