Add product properties added as metafields to email notifications

Add product properties added as metafields to email notifications

Gary_Shop
Visitor
2 0 2

Hi there I'd like to add the metafield entries to the emails for customer and staff notifications. They're displayed on the order landing page, just not the emill. I'd like to learn how to call/display these on the email if anyone can help please? The metafield content is in Grey in the screenshot

Replies 3 (3)

KetanKumar
Shopify Partner
37585 3668 12152

@Gary_Shop  thanks for good post can you something try this  code

{% assign order_items = order.line_items %}
{% for item in order_items %}
    {% assign product = all_products[item.product_id] %}
    <h4>{{ product.title }}</h4>
    <p>Quantity: {{ item.quantity }}</p>
    <p>Price: {{ item.price | money }}</p>
    
    {% if product.metafields.namespace.key %} <!-- Replace 'namespace' and 'key' with your actual metafield namespace and key -->
        <p>Additional Info: {{ product.metafields.namespace.key }}</p>
    {% endif %}
{% endfor %}

 

 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Gary_Shop
Visitor
2 0 2

Thank you very much I'll give this a go tomorrow. Thanks for the fast response!

KetanKumar
Shopify Partner
37585 3668 12152

@Gary_Shop 
Glad I could help

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing