How to cancel one specific email from sending?

Currently it's possible by using a filter hook: "rp_wcec_send_scheduled_email"

The default value is "true", which means all emails are sent.

The parameters are:

  1. a trigger object,
  2. arguments array
  3. customer email's address
  4. customer id

Therefore within your custom code you can check those parameters and then prevent the sending of email for specific case, e.g. for some specific customer:

add_filter('rp_wcec_send_scheduled_email', 'rp_wcec_send_scheduled_email_change');

function rp_wcec_send_scheduled_email_change($send, $trigger, $args, $customer_email, $customer_id) {

// Example condition
if ($customer_id == '123') {
$send = false;
}

return $send;

 

Have more questions? Submit a request