Solved

Interest current date + 7 Days into email template

  • 17 February 2021
  • 3 replies
  • 557 views

Badge +2

Hi There,

 

I need to put an expiration date in a flow template, it show the current date (of email sent to customer) and the expiration date will be 7 days from current date.

 

Ideally it would be the D d M Y format but if this isn’t possible anything else would do.

 

I’ve check Django resources, however have had no luck at getting the date to show correctly.

 

Any help would be greatly appreciated. Thanks, Reece

icon

Best answer by retention 17 February 2021, 20:50

View original

3 replies

Userlevel 7
Badge +57

@Reece Stevenson 

It is possible, but unfortunately not in the D-M-Y format for the +7 days.

 

Today: {% today '%Y-%m-%d' as today %} {{ today }}

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

 

Note the date needs to be in the format '%Y-%m-%d' OR '%Y-%m-%dT%H:%M:%S' OR '%m-%d-%Y' for the +7 days to work.

 

Hope this helps!

Badge +2

Great thanks for the help, Joseph!

Userlevel 5
Badge +12

Hi @retention,

This is still the only option to go with date with time using days_later?
%Y-%m-%dT%H:%M:%S - because wit that structure its not very nice to show in newsletter :)

 

 

Reply