Skip to main content

Hi

We are creating a email template to reminder customers to use their coupon / voucher. We send through a voucher expiry date as part of the event in UTC format

{{ event|lookup:'Coupon Expiry }}

I like to include in my email a reminder to customers to let them know they have XX days left to use their voucher based on Coupon Expiry Date - Time Now

Like: Your voucher expires in 5 days

Can this be calculated as part of the email email formatting in Klaviyo?

Thanks!

Hi there ​@jonoroy

 

Thanks for sharing your question with the Community! 

 

This should be possible, can you share what integration owns this coupon? This will inform how you configure the code to show the expiration date.

 

Thanks for participating in the Community!

-Taylor 


Hi ​@jonoroy,

You can try the “timeuntil” filter.  Just make sure to cast your expiry date string as a date object, I’m using the “format_date_string” filter to do this. If you don’t use a specified date for the timeuntil filter, it implies that it is comparing to the time now.

Roughly, this should work:

{{ event|lookup:'Coupon Expiry’|format_date_string|timeuntil }}

You may have to debug it a bit to make it work.


Hey Jospeh ​@retention,

Thanks so much for this, that worked like a treat!  


Reply