I try to get the order id when adding extra content in woocommerce email, is anyone knows what goes wrong with this…?

add_action( 'woocommerce_email_after_order_table', 'add_content', 20 );

function add_content() {
global $woocommerce;
echo $order_id 
echo $order->id;

Read more here: How to get order id in Woocomerce Email


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: