Conditional tracking link in Shipping notification email based off carrier or country?

Highlighted
Shopify Partner
1 0 0

I've had a hard time finding an answer to this.  One of our companies ships using two different shipping carriers, USPS and FedEx, depending on if the customer is international or domestic.  Is there any way in the tracking email to conditionally set the Track My Package link to display the proper tracking link based off either what carrier is being used or what country the shipment is going to?

I've been looking through this doc: https://help.shopify.com/en/manual/sell-online/notifications/email-variables, but I wasn't seeing anything particularly useful in terms of shipping country.  However I did see 'fulfillment.tracking_company' here, would something like this work (general example)?

{% if {{ fulfillment.tracking_company }} == 'FedEx' %}

  <a href="//fedex.com/tracking/{{ fulfillment.tracking_numbers }}">Track Package</a>

{% else %}

  <a href="//usps.com/tracking/{{ fulfillment.tracking_numbers }}">Track Package</a>

 {% endif %}

*Note, we don't ever ship with multiple tracking numbers, so am I correct in assuming this would populate the url with only one tracking number if only one is provided?

Am I at all on the right track here with this haha?

 

EDIT:  Nevermind, digging more into it I see that how its currently set up will work for our needs.

0 Likes
Highlighted
Shopify Partner
555 1 19

This can be fulfilled with the Multi carrier Shipping label app. Basically, you are looking to select a specific service for label generation based on country and send the tracking link back into the order. This can be achieved with the app.

Product Owner @ PluginHive
Shipping Automation | FedEx shipping | Multi-carrier shipping | Shipment Tracking | Australia Post shipping
0 Likes