Shopify notification email guide

Add an order metafield (like a delivery date) to Shopify emails

What you’ll need

  • Access to Settings in your Shopify admin

    How to get this: Access to Settings in your Shopify admin
    1. Sign in at admin.shopify.com with the account you use for your store.
    2. If you are staff rather than the owner, ask the owner to give you Settings permission in Settings › Users.

    Step-by-step guide (opens in a new tab)

  • Shopify’s email template to paste into

    How to get this: Shopify’s email template to paste into
    1. Settings › Notifications › Customer notifications, open Order confirmation (or the email the tool names), then Edit code.
    2. Copy the current code somewhere safe first, so you can undo.

Make the snippet

Find the namespace and key

In Shopify admin, go to Settings › Metafields and metaobjects › Orders and open the definition. Its namespace and key look like custom.delivery_date.

Steps

  1. In Shopify admin, go to Settings › Notifications › Customer notifications and open Order confirmation. Click Edit code.
  2. Type the namespace.key and label in the builder, and tick Date if it is a date.
  3. Paste the section above the Customer information section.
  4. Click Save, then Preview to check the email. Adding a few lines, instead of replacing the whole template, keeps the rest of Shopify’s template as it is.

Timing matters

The Order confirmation is sent right after checkout. A metafield that an app or Flow sets a few seconds later may not be there yet; it will show in later emails like Shipping confirmation.

Questions

Product or variant metafields?

Inside the item loop use line.product.metafields.NAMESPACE.KEY or line.variant.metafields.NAMESPACE.KEY.

More guides