we are setting up a autoresponder to send to the email of the customer who's order status is changed to completed (were using woocommerce and wordpress and mailster for the autoresponder). The autoresponder and action hook is working properly. The hook triggers the autoresponder to send the email but we can't seem to figure out the code to add so the autoresponder will send the email only to the email of the customer who's order is changed to completed.
We've tried playing with the receivers list provided by the plugin but we can't seem to find the option to put the required condition.
Here's the code we use for the trigger:
function trigger_autoresponder($order_id) {
do_action( 'my_custom_hook' );
}
// add the action
add_action( 'woocommerce_order_status_completed', 'trigger_autoresponder', 10, 1 );
We expected the autoresponder to send the email to customer's email who triggered the hook only. Your help is much appreciated. Thank you so much in advance.