Solved

Adding in expiry date of coupon in email template (FLOW)

  • 7 February 2022
  • 7 replies
  • 987 views

Badge +2

Hello all

Need help please.

 

  1. Shopify integration
  2. I have created a coupon in Klaviyo
  3. Coupon is for $$ off for new customer (Flow)
  4. Coupon expires in 28 days from when they receive the email
  5. How do I add in the dynamic content for the “Hurry offer expires on xxx,xxx) in the email (see below)

 

icon

Best answer by In the Inbox 7 February 2022, 19:11

View original

7 replies

Userlevel 6
Badge +29

Hi @CherieJ 

This is a great question! Including a date to imply when an offer will expire helps drive a higher sense of urgency and gets customers to take action sooner. 

There might be other ways of doing this, but what I ended up setting up with the help of Klaviyo Support was the following dynamic variable:

{% today '%m-%d-%Y' as today %} {{ today|days_later:14 }}

The first bracket sets the current date as “today” and sets the formatting of the date that will show up in the email MM/DD/YYYY. The second bracket will calculate the displayed date in your email depending on how many days in the future you want to show.

In the example above, we set 14 days ‘today|days_later:14’ but based on your criteria, you’d simply update this to ‘28’.

{% today '%m-%d-%Y' as today %} {{ today|days_later:28 }}

I hope that helps!

@In the Inbox 

Userlevel 7
Badge +58

Hi there @CherieJ and welcome to the Community!

Great post and explanation from @In the Inbox. This is going to be the solution you’re looking for in your question. I’d also recommend checking out our related documentation for template tags and variable syntax so you can elevate your emails even further!

Thank you!
Alex

Badge +2

You guys are wonderful!!! Thank you so much!

Badge +1

Any idea how I could possibly do this in the UK date format please…  So DD/MM/YY, when i try 

{% today ‘%d-%m-%Y' as today %} {{ today|days_later:28 }}

It won't accept it….?

Probably an incompatibility thing with Klaviyo defaulting to US format?

Any help would be appreciated

Cheers

 

Userlevel 7
Badge +58

Hi there @adamKlav,

After following the steps on this document, could you update us with the status of whether it worked or not? To my knowledge the formatting in that help center doc should be working.

 

Thanks,

Alex

Badge +1

Hi Alex, I ended up finding another thread on here and it had the solution for UK date format D/M/Y - worked a treat:

 

{% today '%Y-%m-%d' as today %} {{ today|days_later:3|format_date_string|date:'n-j-y' }}

 

Cheers mate

Userlevel 7
Badge +58

Great catch on the proper formatting @adamKlav and I’m glad you found a solution here. Thank you for sharing it with us on here as well.

 

Have a good rest of your day,

Alex

Reply