another email situation.... ah....
with all due respect, i disagree...
the more i see the need for email manipulation, the more usefulness i see for the framework provided in this plugin:
https://www.zen-cart.com/downloads.php?do=file&id=2315
one could copy the notifier to one's admin/includes/classes/observers directory, and change the 2 methods as so:
PHP Code:
public function __construct()
{
$this->attach($this, [
'NOTIFY_EMAIL_READY_TO_SEND',
]);
}
public function update(&$class, $eventID, &$p1, &$p2, &$p3, &$p4, &$p5, &$p6, &$p7, &$p8)
{
switch ($eventID) {
case 'NOTIFY_EMAIL_READY_TO_SEND':
if ($p2->Subject == EMAIL_CUSTOMER_PWD_CHANGE_SUBJECT) {
$p2->clearAddresses();
}
break;
}
}
when an admin changes a password, the following would appear in the message stack:
ERROR: Failed sending email to: "larrys account" with subject: "Account password reset" You must provide at least one recipient email address.
ERROR: Failed sending email to: "larry" with subject: "Account password reset" You must provide at least one recipient email address.
Password updated.
in addition, a debug log now gets generated.
solving this next part of the problem could involve either creating a blackhole email address at your domain and adding that email to the notifier (the top 2 messages in the message stack would disappear) ie after the clearAddresses():
or alternatively, something that i do is to create a cronjob to remove debug logs that i know about and do not need attention (happens a bit with IH); ie:
Code:
#!/bin/bash
grep -li one.recipient.email /var/www/PATH/TO/LOGS/myDEBUG-a* | xargs rm;
a few hoops to jump through, perhaps, but not touching core code has become the holy grail for me.
finally, perhaps the NOTIFY_EMAIL_READY_TO_SEND notifier could incorporate a switch so that an observer could turn it off right there? could be PR time...
best.