d
Topic
markfenske84 Member
Posts:
1
Last edited 13 days ago

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

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.