Linking Products in Shipping emails not working

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 %}