Setting up shipping confirmation when more than one courier used

Topic summary

A Shopify store owner is struggling with shipping confirmation email formatting when orders use multiple couriers.

Current Problem:

  • When multiple couriers are used, the email displays all courier names together, then all tracking numbers together (e.g., “UPS, FedEx” followed by “123, ABC”)
  • This format confuses customers who can’t easily match tracking numbers to their respective carriers

Desired Solution:

  • Display each courier and its tracking number as separate, paired entries
  • Format: Courier name followed immediately by its corresponding tracking number, repeated for each shipment

Code Provided:

  • The user included their current Liquid template code (appears reversed/encoded in the post)
  • The code handles single fulfillments but fails to properly iterate through multiple courier/tracking pairs

Status: The discussion remains open with no solutions provided yet. The user is seeking coding assistance to modify their Shopify email template.

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

Hi guys,

I’m not an expert coder and was hoping someone out there could point me in the right direction. I have a shipping confirmation email that works fine when I only use one courier, but when I use more than one courier for an order it mixes everything up and looks really bad. Currently in this scenario it lists the courier companies first, then lists the tracking numbers, both separated by commas - it looks like below:

Courier Company: UPS, FedEx

Tracking number: 123, ABC

This is really hard for the customers to untangle.

What I’m looking to do is to present each courier separately so it looks like:

Courier Company: UPS

Tracking number: 123

Courier Company: FedEx

Tracking number: ABC

Can anyone out there help? Any thoughts or suggestions would be really appreciated.

I’ve included my current code below:

{% if fulfillment.tracking_numbers.size > 0 %}

{% if fulfillment.tracking_numbers.size == 1 and fulfillment.tracking_company and fulfillment.tracking_url %} Courier Company: {{ fulfillment.tracking_company }}
Tracking number: {{ fulfillment.tracking_numbers.first }} {% elsif fulfillment.tracking_numbers.size == 1 %} Tracking number: {{ fulfillment.tracking_numbers.first }} {% else %} {{ fulfillment.tracking_company }} tracking numbers:
{% for tracking_number in fulfillment.tracking_numbers %} {% if fulfillment.tracking_urls[forloop.index0] %} {{ tracking_number }} {% else %} {{ tracking_number }} {% endif %}