Solved

How to pass dynamic link in custom HTML template?

  • 20 January 2023
  • 1 reply
  • 852 views

Badge +1

I am utilizing Klaviyo to send transactional emails such as Validate Email (when user creates an account) and Reset Password. I am also using my own custom HTML template for these emails. I have been able to test the flow in Postman by creating a custom event and a metric triggered flow. I then use the Track API call to trigger the event and my email is being sent successfully. My next step is to make sure I can add a dynamic link that will expire in 7 days inside of my custom HTML email template. 

 

So far I have looked into the following docs:

Drag & Drop Support

Dynamic Blocks

Date Variables

 

I feel like I’m on the right track but can’t put the pieces together. Can someone point me in the right direction to populate this link dynamically? Thank you!

icon

Best answer by alex.hong 20 January 2023, 22:45

View original

1 reply

Userlevel 7
Badge +58

Hi @sbaqla ,

Welcome to the Community!

This sounds like something that would require use of Track API. From there, you could try include a link as a url property in the event data payload if you want to add a dynamic link to your templates. 

After you get a dynamic variable, you can use it inside your custom html code's href attribute of a link element and apply the necessary style to create a button that takes users to that URL. However, if you wanted to create a link with an expiration date, Klaviyo has no control over it; instead, it is determined by the configuration of the website to which the link takes users.

As a note about Community/Support as well:
Once more, the above information is just intended to be used as a pointer because we are unable to give you the exact code required here for your custom template. If you need any further help with this, I would advise you to reach out to your theme developer but if you do not have one on your team, you may be interested in connecting with one of our Klaviyo partners:
https://klaviyo.partnerpage.io/

Reply