E-Mail Settings don’t apply in woocommerce_payment_complete
-
Hi!
I need to send the Order Confirmation E-Mail after the Order/Payment is completed.
I am doing this in the below code
But when I do this, no settings of the Order Confirmation E-Mail I’ve set in WooCommerce > Settings > E-Mails > Order Confirmation get applied, so the Subject stays the same as default WC, Confirmation Text stays the same as default…The Confirmation gets sent on the normal WC way, after the Order is made, the right Subject etc from the settings is applied.
add_action( 'woocommerce_payment_complete', 'lw_payment_complete' ); function lw_payment_complete( $order_id ){ $mails = WC()->mailer()->emails; $email_o = $mails['WC_Email_Customer_Completed_Order']; //it does not matter if i take this $email_o = new WC_Email_Customer_Completed_Order(); instead of the 2 rows above. $email_o->trigger($order_id); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘E-Mail Settings don’t apply in woocommerce_payment_complete’ is closed to new replies.