Skip to content

Instantly share code, notes, and snippets.

@webdados
Created March 22, 2022 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/a94e0e85af511ae6e63cba95a24a86c6 to your computer and use it in GitHub Desktop.
Save webdados/a94e0e85af511ae6e63cba95a24a86c6 to your computer and use it in GitHub Desktop.
Remove IfthenPay payment instructions from some WooCommerce emails
<?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