Created
March 22, 2022 13:03
-
-
Save webdados/a94e0e85af511ae6e63cba95a24a86c6 to your computer and use it in GitHub Desktop.
Remove IfthenPay payment instructions from some WooCommerce emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'multibanco_ifthen_send_email_instructions', 'my_multibanco_ifthen_send_email_instructions', 10, 5 ); | |
add_filter( 'mbway_ifthen_send_email_instructions', 'my_multibanco_ifthen_send_email_instructions', 10, 5 ); | |
add_filter( 'creditcard_ifthen_send_email_instructions', 'my_multibanco_ifthen_send_email_instructions', 10, 5 ); | |
add_filter( 'payshop_ifthen_send_email_instructions', 'my_multibanco_ifthen_send_email_instructions', 10, 5 ); | |
function my_multibanco_ifthen_send_email_instructions( $send, $order, $sent_to_admin, $plain_text, $email ) { | |
$emails_to_remove = array( | |
'customer_completed_order', | |
'customer_refunded_order' | |
//You can add other emails here. You just need to check the id of each email of the WooCommerce files | |
); | |
if ( $email && $email->id ) return in_array( $email->id, $emails_to_remove ); | |
return $send; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment