@peppol yes we can do that in a future release, it’s a good idea. For now, if you need help patching something right this second, I do have a solution for you.
2 locations need to be touched:
1. class-mailchimp-woocommerce-single-order.php
/**
* @param $email
* @param $order_id
* @return bool
*/
protected function shouldSkipOrder($email, $order_id)
{
// basically do whatever you need to do to decide the logic.
//if (execute_your_custom_filter($email)) return true;
if (!is_email($email)) {
mailchimp_log('validation.bad_email', "Order #{$order_id} has an invalid email address. Skipping!");
return true;
}
// make sure we can submit this order to MailChimp or skip it.
if (mailchimp_email_is_amazon($email)) {
mailchimp_log('validation.amazon', "Order #{$order_id} was placed through Amazon. Skipping!");
return true;
}
if (mailchimp_email_is_privacy_protected($email)) {
mailchimp_log('validation.gdpr', "Order #{$order_id} is GDPR restricted. Skipping!");
return true;
}
return false;
}
And also in the bootstrap.php file
/**
* @param $email
* @return bool
*/
function mailchimp_email_is_allowed($email) {
// basically do whatever you need to do to decide the logic.
//if (execute_your_custom_filter($email)) return false;
if (!is_email($email) || mailchimp_email_is_amazon($email) || mailchimp_email_is_privacy_protected($email)) {
return false;
}
return true;
}
We will think this through in our next release to add a custom filter for both skipping the list members and also the orders for you and report back. Again thanks for the idea. 🙂