Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 1

Stop sending “processing order” e-mail when WooCommerce order status pending payment

I have a strange problem with WooCommerce shop. When the customer orders something on my shop with Klarna or PayPal gateway, the user is getting the processing order e-mail, even though the order is not yet processed by Klarna or PayPal.

Is there any possibility to stop sending processing order e-mails when WooCommerce order status is pending payment?

I have tried this code but it doesn't change anything

function manipulate_woocommerce_email_sending($email_class){
    remove_action('woocommerce_order_status_pending_to_on-hold_notification', array($email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger'));
    add_action('woocommerce_order_status_on-hold_to_processing_notification', array($email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger'));
}
add_action ('woocommerce_email', 'manipulate_woocommerce_email_sending');

and i tried this: but no luck

/** * Unhook and remove WooCommerce default emails. */ add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); function unhook_those_pesky_emails( $email_class ) { // New order emails remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_New_Order'], 'trigger' ) ); } 

thank you very much for you help