Linking Products in Shipping emails not working

Topic summary

A user is experiencing issues with product links in shipping-related email templates (shipping confirmation, shipping update, out for delivery, and delivered emails).

Working vs. Not Working:

  • In Order Confirmation emails, the code {% assign line_title = line.product.title %} successfully creates clickable product links
  • In shipping emails, the same approach only links to the shop URL instead of individual product pages

Current Implementation:
The user shared their code snippet showing they’re using line.line_item.product.title for shipping emails and attempting to create links with {{ line_title }}. The code includes logic for handling product titles, quantities, discounts, refunds, and selling plans.

Status: The issue remains unresolved with no responses yet. The core problem appears to be a difference in how the Liquid template variables work between order confirmation and shipping notification email templates.

Summarized with AI on November 21. AI used: claude-sonnet-4-5-20250929.

I would like to have the products listed in these emails link to their respective product pages.

Shipping confirmation

Shipping update

Out for delivery

Delivered

in the Order Confirmation emails,

{% assign line_title = line.product.title %}

works just fine.

However, in all the other emails, only the shop url is linking.


{{ line_title }} × {{ line_display }}

here is all the code in that td cell:


          {% if line.line_item.product.title %}	
            {% assign line_title = line.line_item.product.title %}	
          {% else %}	
            {% assign line_title = line.line_item.title %}	
          {% endif %}

          {% if line.quantity < line.line_item.quantity %}
            {% capture line_display %} {{ line.quantity }} of {{ line.line_item.quantity }} {% endcapture %}
          {% else %}
            {% assign line_display = line.line_item.quantity  %}
          {% endif %}

          {{ line_title }} × {{ line_display }}

          {% if line.line_item.variant.title != 'Default Title' %}
            {{ line.line_item.variant.title }}

          {% endif %}

          {% if line.line_item.selling_plan_allocation %}
            {{ line.line_item.selling_plan_allocation.selling_plan.name }}

          {% endif %}

          {% if line.line_item.refunded_quantity > 0 %}
            Refunded
          {% endif %}

          {% if line.line_item.discount_allocations %}
            {% for discount_allocation in line.line_item.discount_allocations %}
              {% if discount_allocation.discount_application.target_selection != 'all' %}
                
                  
                  
                    {{ discount_allocation.discount_application.title | upcase }}
                    (-{{ discount_allocation.amount | money }})
                  
                
              {% endif %}
            {% endfor %}
          {% endif %}