View Categories

The Order Meta Shortcode for Status Emails

Additional Custom Order Status for WooCommerce includes one shortcode, [alg_wc_os_order_meta], which prints a value from the order’s meta data. It is designed for use inside a custom status email, so you can pull custom fields into the message. Status emails are a Pro feature.

Basic usage #

[alg_wc_os_order_meta key="your_meta_key"]

This outputs the value of the order meta stored under your_meta_key. If the meta is empty, the shortcode outputs nothing.

Attributes #

Attribute Description
key The order meta key to read. Required for any output.
sub_key For meta stored as an array, drills into nested keys. Accepts a comma-separated path, for example sub_key="shipping,method".
before Text printed before the value, only when a value exists.
after Text printed after the value, only when a value exists.

Example #

[alg_wc_os_order_meta key="_delivery_date" before="Delivery date: " after="<br>"]

If the order has a _delivery_date meta value, this prints “Delivery date:” followed by the value and a line break. If it does not, nothing is printed, so there is no empty label.

Note: the shortcode reads the order being processed for the email, so it is meant for the Content field of a custom status email. It has no order context on a normal page or post.

Set up status emails #

The order meta shortcode works inside Pro status emails. See how to send automated emails on status change, or get Custom Order Status Pro.