Display Order-specific image in shipping notification email

Display Order-specific image in shipping notification email

SophiePeacock01
Shopify Partner
4 0 1

Hi there,

 

I’d like to add an order-specific image into the Shipping confirmation email that the customer receives, without having to upload it to the Files section. 


Context: when we ship an order, we send a photo of the items packaged for delivery. Currently we are doing this as a seperate manual email but it’s getting tedious and I’d love to automate it. 

I have created a custom order metafield for an image file, but cannot work out how to display this image in the shipping email. 

I have also had a play with adding the image to the timeline comments, but cannot get this to display either. 

I’ll attach some screenshots showing the metafield configuration, and the image attached to the order:

 

IMG_7798.png

IMG_7799.png

IMG_7801.png

I have tried a variety of codes in the email template, the latest being:

 

{% assign image_url = order.metafields.custom.shipment_image %}
{% if image_url != blank %}
<img src="{{ image_url.value | img_tag }}" alt="{{ image_url.value.alt }}">
{% endif %}

I would appreciate any ideas on how to achieve this, and if it’s through code, advise on where exactly within the template it should be added. 

Thank you!

Replies 0 (0)