How do I access line item properties in an email template?

I’m putting together a shipping confirmation email, which should include the order with details(quantity, SKU, image) about each line item. Like this:

However, when I view all available variables in Preview mode, there are no properties for the line items. Literally only the item’s title is available.

I’m not sure what you are showing there as it’s not a Flow UI. But properties are called “Custom Attributes” in the GraphQL API

Hi @ctevan

The “Preview” sidebar in Shopify is misleading because it uses simplified dummy data that often hides nested properties like images or SKUs, even though they exist in the actual email.

To fix this, you must loop through the specific items in the shipment (not the whole order) using the fulfillment object

{% for line in fulfillment.fulfillment_line_items %}
  {% if line.line_item.image %}
    <img src="{{ line.line_item.image | img_url: 'compact_cropped' }}" alt="{{ line.line_item.title }}" />
  {% endif %}

  <p>{{ line.line_item.title }}</p>
  <p>SKU: {{ line.line_item.sku }}</p>

  <p>Quantity: {{ line.quantity }}</p>
{% endfor %}

Paste this in your template and let me know how it goes!

Make Use of a transactional email template that loops over the order’s line items and injects each item’s quantity, SKU, and image dynamically (e.g., via a template engine or ESP merge tags)

Hello ctevan!!

From my understading I belive that in Shopify email templates, line item properties are available only when you loop through the order’s line items, and they won’t always appear in the preview. Using the correct loop structure helps surface custom attributes added at checkout.

For cases where line item properties need to be consistently accessible beyond emails, such as for fulfillment, reporting, or operational workflows, using an OMS that syncs and manages detailed order-item attributes from Shopify can help ensure those custom properties are preserved and usable across systems, not just in notifications.