Send additional emails to the order form WooCommerce
-
Hello everyone,
I created a birth list plugin for a client. The procedure is simple, purchase from a birthlist, arrived in the shopping cart, order with a possible message for the recipient of the list (the creator of the list actually) and payment.
Once the payment is made, the email of the standard order form (WC) is sent to the administrator of the site and my plugin sends two emails, one to the administrator of the site (recap of the purchase of birth list) And one to the creator of the list to warn him that products were bought on one of his birth lists.
Until then, you will tell me, where is the problem … It is very simple. To send my emails, I go through the following action “woocommerce_thankyou” and modify in the wake the DB.
But now, with the standard WC payment outputs, everything is fine but not when your customer has a TPE (gateway Monetico).
I therefore realized that the email of order form is sent with a validation of the TPE but no need to click on “back to the shop” while I, the customer must click on this button “back to the shop”.
So I tried a lot of methods (woocommerce_checkout_order_processed, woocommerce_payment_complete, woocommerce_order_status_changed, woocommerce_payment_complete_order_status) and possible actions with always the same result 🙁
I said to myself, I have to put my function to the level of sending the email of the order form and I tried this action “woocommerce_email_order_details”, and the result is always the same. My emails only leave if the customer clicks on this damn button “return to the shop” when paying.
So there is probably a method, like a filter, a cron or other things that I did not do of course. Could you help me get out of this nightmare 😉
Patrice
- The topic ‘Send additional emails to the order form WooCommerce’ is closed to new replies.