[Server error] Issue with Notification Email Metafield Retrieval

[Server error] Issue with Notification Email Metafield Retrieval

riri9387384
Shopify Partner
1 0 0

I used the following code in my Shipping confirmation notification email, and it used to return the value a few days ago. However, it suddenly stopped working without any changes to the metafields:
```
{{order.metafields.custom.something}}
```

The code `{{order.metafields}}` returns MetafieldCollectionDrop, but `{{order.metafields.custom}}` now returns an empty {}.


Additionally, previewing `{{order.metafields.custom.something}}` in the email templates editor returns a Server error. Inspecting the network tab shows an Internal server error in the API without any specific details.

Reply 1 (1)

Liam
Shopify Staff
2873 312 820

Hi Riri,

In our docs, it doesn't seem that order metafields can be accessed with `{{order.metafields.custom.X}}` - you can access line items but not orders. Can you share an example where this was working as you've described, by DM so our team can look into this more?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog