I need to send these two emails after the checkout.
1.- Woocommerce automatic email (summerizing the order, prince, total price, etc).
2.- Email with aditional information.
I have been looking and I can't do it from WooCommerce plugin and I can't use other plugins like Shopmagic, so ... It has to be with code.
After than a lot of time searching, I think could be something like this.
(The order of status control is processing and no completed because I'm testing with test-mode in Stripe and Stripe, in test mode, orders are defined as "processing" status, not completed.
What I have from now in my functions.php file is this:
$order = new WC_Order( $order_id );
function order_processing( $order_id ) {
$order = new WC_Order( $order_id );
$to_email = $order["billing_address"];
$headers = 'From: Your Name <alexiglesiasvortex@gmail.com>' . "\r\n";
wp_mail($to_email, 'subject', '<h1>This is a test for my new pending email.</h1><p>Agree, this is a test</p>', $headers );
}
add_action( 'woocommerce_payment_processing', 'order_processing' );
Currently, this is not working ... I don't get any error and checkout ends correctly, but no new email arrives to my inbox.
I need some help, guys, someone can help me? Thank you a lot and have a good monday!