Skip to main content
Solved

How to add Promotion Time base on the Dynamic Coupon


Forum|alt.badge.img+4

If I have created an abandoned email using flow and included Dynamic Promotion Code inside the email.

The promotion will only be activated when the email send out, and ends in 3 hours after the email is out.  

How can I show the start and end date of the Promotion in the email Content

Best answer by David To

Hello @pmjchan,

Great question! 

Although it is possible to display the current date and time the email was sent out and even display a time X-days later; it is currently not possible to calculate X-hours later. 

To display the current date and time, you can use the following syntax: {% today "%m/%d/%Y %I:%M" as today %} {{ today }} which would display as 07/02/2021 04:05. You can also re-order and redisplay how the dates and time is rendered by referencing the Django filters and tags available here: https://docs.djangoproject.com/en/1.8/ref/templates/builtins/

Furthermore, if you did decide to opt-in to using X-days later instead, @retention has a great answer in the following Community post. I would also suggest taking a look at the How to Format Date Variables in Templates article to learn more about formatting dates within a template. 

I hope this helps!

David
 

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

3 replies

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

Hello @pmjchan,

Great question! 

Although it is possible to display the current date and time the email was sent out and even display a time X-days later; it is currently not possible to calculate X-hours later. 

To display the current date and time, you can use the following syntax: {% today "%m/%d/%Y %I:%M" as today %} {{ today }} which would display as 07/02/2021 04:05. You can also re-order and redisplay how the dates and time is rendered by referencing the Django filters and tags available here: https://docs.djangoproject.com/en/1.8/ref/templates/builtins/

Furthermore, if you did decide to opt-in to using X-days later instead, @retention has a great answer in the following Community post. I would also suggest taking a look at the How to Format Date Variables in Templates article to learn more about formatting dates within a template. 

I hope this helps!

David
 


Forum|alt.badge.img+1
  • Contributor I
  • 2 replies
  • December 26, 2024

Does this definitely display the date the email is sent out +7 days or does it display the date the email is opened + 7 days?


JessFosnough
Expert Problem Solver IV
Forum|alt.badge.img+23
  • Expert Problem Solver IV
  • 194 replies
  • December 26, 2024

@Klum House,

It has been a while since I have done testing, and I can’t remember for sure - but I think it displays the date 7 days after the email is opened. To test it yourself, insert the code below into an email and send it to yourself:

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

Wait at least 24 hours before opening the email, and see if the display date is 7 days from the send date or open date.

Good luck!