Created
May 24, 2019 08:56
-
-
Save JeroenSormani/cd9fde19426252f173aad3e265a03877 to your computer and use it in GitHub Desktop.
Custom Conversio receipt triggers
This file contains hidden or 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 | |
if ( function_exists( 'Conversio' ) ) { | |
// Remove all existing triggers | |
remove_action( 'woocommerce_order_status_pending_to_processing', array( Conversio()->email, 'send_transactional_email' ) ); | |
remove_action( 'woocommerce_order_status_on-hold_to_processing', array( Conversio()->email, 'send_transactional_email' ) ); | |
remove_action( 'woocommerce_order_status_pending_to_completed', array( Conversio()->email, 'send_transactional_email' ) ); | |
// Add custom triggers - change accordingly to your own needs | |
add_action( 'woocommerce_order_status_pending_to_completed', array( Conversio()->email, 'send_transactional_email' ) ); // Specific status change | |
add_action( 'woocommerce_order_status_completed_notification', array( Conversio()->email, 'send_transactional_email' ) ); // When order is changed to a specific status | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment