Hi @ixistudio ,
I hope you are doing well.
Technically our plugin helps you connect with SMTP service and only sends the email if WooCommerce shares it to deliver. If the code you are using is correct, it should work. With a quick exploration, I found an alternate for your case.
https://stackoverflow.com/questions/45971014/woocommerce-email-recipient-customer-completed-order-hook-not-being-invoked
I haven’t tested the above code on my end, but it might help you.
Do let us know if still there is any thing we can help you with.
Thanks and regards,
Support Team – WPExperts
Thread Starter
Alberto
(@ixistudio)
That makes sense, thanks.
I used the code below to disable customer email notifications based on a user meta value. This is for Woocommerce:
// Disable Shop email notifications for user
function ixn_wc_send_notification_option( $recipient, $order ) {
$customer_id = $order->get_customer_id();
$disable_emails = get_user_meta( $customer_id, 'ixn_cp_option_wc_emails', true );
if( $disable_emails == "disabled" ){
$recipient = '';
}
return $recipient;
}
add_filter( 'woocommerce_email_recipient_customer_on_hold_order', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_processing_order', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_completed_order', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_refunded_order', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_partially_refunded_order', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_invoice', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_note', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_reset_password', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_customer_new_account', 'ixn_wc_send_notification_option', 10, 2 );
add_filter( 'woocommerce_email_recipient_ixi_subscription_cancelled', 'ixn_wc_send_notification_option', 10, 2 );
-
This reply was modified 3 years, 2 months ago by
Alberto.