woocommerce offtopic – Custom Email via Hook only for completed order

Question

I wanted to customize completed order with some extra information.
To do so, I added this in functions.php

add_action( 'woocommerce_email_before_order_table', 'mm_email_before_order_table', 10, 4 );
function mm_email_before_order_table( $order, $sent_to_admin, $plain_text, $email ) { 
   echo '<p>extra information</p>';
}

How can I ensure this to work only for completed emails and not other emails (e.g. order creation)

Thank you so much

0
lt512 2 months 2021-08-12T02:51:45-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse