All Collections
Email Customizer Plus for WooCommerce
How get order meta data in Email Customizer Plus
How get order meta data in Email Customizer Plus

Learn how to fetch order meta in your email templates using the Email Customizer Plus

Ramesh avatar
Written by Ramesh
Updated over a week ago

WooCommerce saves any additional order information in the Post Meta table in a key value format.

While the Email Customizer Plus supports all the built-in default values of the order object, there might be scenarios where you might have used a plugin or created custom fields to save additional information for an order.

A good example is the Shipment Tracking ID. Here is a screenshot showing the custom field

WooCommerce allows adding additional values to every order using the "Custom Fields" section.

This custom field usually gets saved in the wp_postmeta table as a meta_key and meta_value

In the above example,

meta_key = tracking_id (it is always good to use an underscore instead of spaces)
meta_value = 123433535


Similarly, most shipment tracking id plugins save the data to the order (post) meta table. You can easily cross-check with the developer of the plugin to know where they save the data. It would most probably in the order meta (post meta) table.

Also, you can add your own custom data as order values. WooCommerce allows "Adding Custom Field" in every order and save as order meta

Or if you have created any additional custom fields in your orders, you can easily add the information to your emails by just adding a shortcode.

Step 1: Make sure you created the custom field or get the existing field's key

Go to your WordPress dashboard -> WooCommerce -> Orders

Open an order and scroll to the bottom of the record.

You will see both existing Meta Name/Key and their values for the order.

You can also create new value for the order by click "Enter New" link

NOTE: Once created, this Meta Name / Key will be available in the "Select list" in all other orders. So you can simply select and just enter the values. Save.

Step 2: How to fetch this order meta in email template

Just go to your WooCommerce -> Email Customizer Plus -> Edit the Email Template where you wanted to include the order meta

Add a short code in the following format: {{order_meta.your_meta_key}}

In our example, it will be: {{order_meta.tracking_id}}

When the email is sent, Email Customizer will fetch the correct value for the respective order and its meta key.

Here is a screenshot:

Using this method, you can fetch any dynamic value given in the "order meta" into your emails.

Did this answer your question?