Dynamic links | Community
Skip to main content
Level 2
June 28, 2018

Dynamic links

  • June 28, 2018
  • 1 reply
  • 3824 views

Hello there!

I have an email that has a Download now CTA that should point to a link that is split based on the Country. There are a total of 14 different links and instead of creating 14 different emails with 14 different links can this be optimized so that we can have one HTML email that has some scripting and it will automatically prepares the link based on the subscriber's country value from the database?

Thanks so much!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Level 2
June 28, 2018

This can be done multiple ways, depending on how your data and links are set up.  Three ways off the top of my head are:

1. The easiest way is to just use personalization within the link:

<a href="http://somelink.com/<%= recipient.country %>/download.pdf">...</a>

2. You can also use if/else or switch statements in the HTML template if the links are drastically different.

<% if (recipient.country=='XX') { %>

  <a href="">Some Link</a>

<% } else if (recipient.country=='YY') { %>

<a href="">Some other link</a>

<% } else { %>

  <a href="">Default</a>

<% } %>

3. You can create and populate a lookup table that you can join to the recipient table on country code and populate it with all the links.  This is better than #2 to manage (IMO).

CountryURL
XXwww.somelink.com
YYwww.otherlink.com

Depending on how you set it up, you just reference it as personalization data in the template.  I left off the "https", as you will need to add it in the template so Adobe can add tracking:

<a href="https://<%=recipient.countryLinks.url %>">...</a>

YashP1Author
Level 2
June 29, 2018

Thanks so much! Appreciate your help.