0

I'm using Send an Email notification to the admin for pending order status in WooCommerce which works fine.

Is there a way I can disable admin email when the order is change to pending>processing ? because when ever I change to pending > processing " new order " email generates and duplicates mail.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Ezeelo
  • 9
  • 4

1 Answers1

1

You use woocommerce_email action hook and inside that callback function you can remove woocommerce_order_status_pending_to_processing_notification this action hook. check below code. Code goes in active theme functions.php file.

add_action( 'woocommerce_email', 'stop_processing_email_admin' );
function stop_processing_email_admin( $email_class ) {
    remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) );
}
Bhautik
  • 11,125
  • 3
  • 16
  • 38
  • I know this works for cash on delivery, is it possible to get the same process for credit card purchases @Bhautik – Ezeelo Apr 20 '21 at 05:10
  • Yes, it will work with both process. – Bhautik Apr 20 '21 at 05:12
  • Hey @Bhautik when a customer places an order via credit card it auto changes from pending to processing, is there a specific hook so i can keep it on pending when new order is placed. so far COD works fine new order goes as pending but credit card it auto changed pending to processing. – Ezeelo Apr 20 '21 at 05:32