Replies: 0
Hi,
I would like to prevent debit transaction emails on my site.
Kindly review my code below to confirm that it is fine.
/**
* Prevent debit transaction emails.
*/
add_filter( 'woocommerce_email_recipient_new_wallet_transaction', 'prevent_debit_email, 10, 3 );
function prevent_debit_email( $recipient, $user, $transaction ) {
if ( $transaction->type === 'debit' ) {
return false;
}
return $recipient;
}
Thanks a lot.
Sadiq