Skip to main content
Solved

Flow Coupon Expiration Date Dynamic Tag

  • September 5, 2021
  • 8 replies
  • 983 views

Forum|alt.badge.img+2

Is there a way to dynamically pull in the coupon expiration date into a email in a Flow. I am generating the coupons at time of send and using {% coupon_code 'NAME_OF_YOUR_COUPON' %} in the initial email and also the reminders. I would like to put a date in the email showing the expiration date. 

I have tried {% expiration_date 'NAME_OF_YOUR_COUPON' %} with no luck. 

Thanks

Best answer by David To

Hello @Ejames,

Thanks for sharing your question with the Klaviyo Community!

Although it is not possible to dynamically pull in the coupon’s expiration date, you can get around this by dynamically calculate and display the expiration date of the coupon in your email! You can do so by using the {% today '%Y-%m-%d' as today %} {{ today|days_later:7 }} variables as @retention had highlighted. You can find their solution as another Community post similar on this topic below:

I would also suggest taking a look at the How to Format Date Variables in Templates Help Center article to learn more about formatting dates within a template. 

Thanks for being a part of the Klaviyo Community!

David

View original
Did this topic or the replies in the thread help you find an answer to your question?

8 replies

David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • Answer
  • September 7, 2021

Hello @Ejames,

Thanks for sharing your question with the Klaviyo Community!

Although it is not possible to dynamically pull in the coupon’s expiration date, you can get around this by dynamically calculate and display the expiration date of the coupon in your email! You can do so by using the {% today '%Y-%m-%d' as today %} {{ today|days_later:7 }} variables as @retention had highlighted. You can find their solution as another Community post similar on this topic below:

I would also suggest taking a look at the How to Format Date Variables in Templates Help Center article to learn more about formatting dates within a template. 

Thanks for being a part of the Klaviyo Community!

David


Forum|alt.badge.img+2
  • Contributor I
  • 4 replies
  • July 18, 2022

Any way to create dynamic coupons ( the coupon code can be email only ) in WooCommerce when someone subscribes to a list in Klaviyo.

I saw this possible for for Magento and Shopify.

Any actions in your plugin that will allows us to create a coupon code in WooCommerce or some other way when there is a successful subscription in Klaviyo.

I’m trying to test 5,7,9,11,13, 15 day coupon windows with different flows in an A/B test…

I’d like the coupon expiration to start when they subscribe or get the first welcome email…

 

 

 

 

Thanks


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • July 19, 2022

Hey @Marketingguy,

Although Klaviyo does not have the same coupon generation capability for WooCommerce as we would for Shopify and Magento; you can still offer dynamic coupons from Klaviyo when using a WooCommerce integration. If you haven’t had a chance to yet, I would suggest taking a look at our Guide to Creating Coupons in WooCommerce Help Center article. 

I’ve also previously explained this in a similar Community post which I’ve included below:

David


Forum|alt.badge.img+2
  • Contributor I
  • 4 replies
  • July 19, 2022

Here’s what my developer said: 

 

we need dynamic expiry date based on the send time.

 

yes in this case we are out of options with klaviyo+woo, since klaviyo has no control over woo's coupon expiry settings.

 

Is this accurate? Is there a workaround here? 


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • July 20, 2022

Hey @Marketingguy,

Gotcha, that would be accurate. Since Klaviyo isn’t actually the issuer/generator of these coupons, we would have no control over the issue date and thus be unable to determine a unique expiration date for the said coupon with WooCommerce. When using uploaded coupons, you can think of Klaviyo as randomly assigning those valid coupon codes within an email. The expiration date would typically be pre-determined within your WooCommerce/BigCommerce backend. 

Although there are no current work arounds for this within Klaviyo, you may want to explore if other third-party providers could help alleviate this limitation. Our Product Teams are actively working towards improving the integration capability Klaviyo has with WooCommerce and the ability to generate coupons from Klaviyo is a feature that has been shared with them on numerous occasions. When such a feature becomes available, I’m sure we’ll provide an announcement on it.

David


Forum|alt.badge.img
  • Contributor I
  • 2 replies
  • February 21, 2025

Hi ​@David To,

 

your replies were very helpful, although I would need a different format to be displayed in my Flow Email, i.e. dd.mm.yyyy. Is there a Code I can use to transform the expiring date?

Thank you very much in advance for your reply.


JessFosnough
Expert Problem Solver IV
Forum|alt.badge.img+23
  • Expert Problem Solver IV
  • 195 replies
  • February 25, 2025

Hi ​@StephiK,

Here’s a reference to the django date options. Let me know if you need more info!
https://docs.djangoproject.com/en/5.1/ref/templates/builtins/#date


Forum|alt.badge.img
  • Contributor I
  • 2 replies
  • February 26, 2025

Thank you Jessica! That’s very helpful.