Do not send customer email when order status is on hold

This commit is contained in:
dinamiko 2021-06-10 11:05:29 +02:00
parent f1555d4db4
commit 9e7b12f16b

View file

@ -135,6 +135,18 @@ class WcGatewayModule implements ModuleInterface {
$endpoint->handle_request();
}
);
add_filter(
'woocommerce_email_recipient_customer_on_hold_order',
function( $recipient, $order ) {
if ( $order->get_payment_method() === PayPalGateway::ID || $order->get_payment_method() === CreditCardGateway::ID ) {
$recipient = '';
}
return $recipient;
},
10,
2
);
}
/**