Hello @hidethegarlic
To achieve this, simply customize the Completed Order email template. For example, you can include the tracking number in the email template by using the following code snippet:
$order_notes = $order->get_customer_order_notes();
if ( ! empty( $order_notes ) ) {
foreach ( $order_notes as $order_note ) {
if ( strpos( $order_note->comment_content, 'Tracking number:' ) !== false ) {
echo '
' . __( 'Tracking number:', 'woocommerce' ) . ' ' . $order_note->comment_content . '
';
}
}
}
?>
This code snippet will check if there’s a customer note containing the tracking number and display it in the Completed Order email.
Please note that modifying the email template requires some knowledge of PHP and HTML. If you’re not comfortable with making these changes, I recommend seeking assistance from a developer or someone experienced in customizing WooCommerce templates.
Here are some additional resource that might be helpful:
I hope this helps! Thanks!
Thank you for this @shameemreza I really appreciate your help. I’ve just added this to the email template and got this result
https://pasteboard.co/SSBHx57z2TjP.png
Oh and also the notes I get the tracking with are private notes?
Thanks
Hi there @hidethegarlic 👋
Thank you for contacting Woo support!
First, apologies for the delay. We have seen a recent influx of tickets and are currently working through a backlog.
Include Tracking Number on Completed Order Email
As I understand, you would like to automate things with including the order note containing the tracking number in an email sent out automatically. Correct?
Feel free to check out AutomateWoo, and its long list of available triggers (linked here), as AutomateWoo has the tools you need to grow your store.
Its value is in that it allows you to create Workflows – which are made up of different combinations of Triggers, Rules and Actions within WooCommerce.
I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.
Thanks for that, it looks like it will do the job!
Hi @hidethegarlic
You’re welcome! I am going to mark this ticket as resolved, If you have any new questions, please create a new ticket.
Cheers!