You can show different content in an UpOrder notification email based on the Shopify product tags attached to each purchased product. The cleanest way to do this is through the Line Items component's advanced Code (Html/Liquid) to apply to each line item field.
This field is different from a regular Code component. UpOrder runs it once for each line item, so the current item is already available as line. That means you can check line.product.tags directly, and you do not need to loop through line_items yourself.
Before you start
Make sure the products you want to target are tagged in Shopify. When you write your condition, copy the tag value from Shopify so the Liquid is easy to review and test.
You can learn more about Shopify tags here: Creating and using tags in Shopify.
This approach is best when product-specific content should appear beside or below each matching item in the order. Common examples include care instructions, sizing notes, setup instructions, digital product reminders, gift card notes, or product-specific support links.
How it works
Inside the Line Items component, the current line item is available as line. To check whether that product has a tag, use:
line.product.tags contains "Bags"
Because the code is applied to each line item, the content will only appear for items where the condition is true.
How to add content based on product tags
Open UpOrder from your Shopify admin.
Open the template set you want to edit.
Choose the notification template where you want the product-specific content to appear, such as Order Confirmation or Shipping Confirmation.
Select the Line Items component in the left sidebar or in the email preview.
In the Line Items settings panel, enable Show Advanced.
Find the field labeled Code (Html/Liquid) to apply to each line item.
Paste your Liquid and HTML into that field.
Save your changes.
Test with an order that includes a product using the tag you are targeting.
Publish the updated template to Shopify when you are ready for customers to receive it.
Simple example: show bag care instructions
This example adds a short care note below any line item where the product is tagged Bags:
{% if line.product.tags contains "Bags" %}
<div style="margin-top: 12px; font-size: 14px; line-height: 1.5; color: #5E5E5E;">
<strong style="color: #242424;">Bag care tip:</strong>
Spot clean with mild soap and let it air dry before storing.
</div>
{% endif %}
Only products tagged Bags will show this message. Other products in the same order will not show it.
Example: show different content for different tags
You can also use elsif to show different messages for different product tags:
{% if line.product.tags contains "Bags" %}
<div style="margin-top: 12px; font-size: 14px; line-height: 1.5; color: #5E5E5E;">
<strong style="color: #242424;">Bag care tip:</strong>
Spot clean with mild soap and let it air dry before storing.
</div>
{% elsif line.product.tags contains "Leather" %}
<div style="margin-top: 12px; font-size: 14px; line-height: 1.5; color: #5E5E5E;">
<strong style="color: #242424;">Leather care tip:</strong>
Keep away from excess moisture and condition as needed.
</div>
{% elsif line.product.tags contains "GiftCard" %}
<div style="margin-top: 12px; font-size: 14px; line-height: 1.5; color: #5E5E5E;">
<strong style="color: #242424;">Gift card note:</strong>
Your gift card details are included in this email.
</div>
{% endif %}
This version shows the first matching message for each line item. If a product has more than one of these tags and you want every matching message to appear, use separate if statements instead of elsif.
Important notes
Do not add a
{% for line in line_items %}loop in this field. UpOrder already applies the code to each line item.Use
line.product.tags, notline_item.product.tags, in this field.Product tags must already exist on the product in Shopify.
A regular builder preview or Shopify test email might not include the product data you need to validate this. The best test is a test order that includes a product with the matching tag.
Keep the HTML simple. Email clients can be strict, so inline styles are safer than complex layouts or external CSS.
Testing your changes
Create a test order with a product tagged Bags, Leather, or whichever tag you used in your code. Then review the notification email and confirm that the product-specific content appears only under the matching line item.
If the content does not appear, check the product tag in Shopify and make sure it matches the tag in your Liquid condition.
Troubleshooting
The content is not showing: Confirm the product has the tag used in the code and that you tested with an order containing that product.
The content is showing for the wrong product: Review the tag used in your condition and make sure the product is not using the same tag unintentionally.
The layout looks off: Simplify the HTML and use inline styles. Avoid adding large blocks, scripts, or external CSS in this field.
Related Shopify references
Please reach out to [email protected] or through the in-app chat if you have any questions.

