Skip to main content
Solved

Using {% current_year %} in templates is sending with year 2022. Why?

  • January 25, 2024
  • 1 reply
  • 470 views

telestrial
Problem Solver I
Forum|alt.badge.img+2

As the title say, I started using {% current_year %} in a custom email template, and these are sending with the year 2022. Any ideas?

 

©{% current_year %} Shine Wedding Invitations

 

As this is a custom template, I’ve checked locally and inside the Klaviyo editor, just to be sure: The above variable is in my code. I didn’t forget to add it on the Klaviyo side of the equation or something like that. Not really sure what’s going on here.

 

Thank you for any help you may be able to provide!

Best answer by telestrial

The solution here: {% current_year %} is for in-klaviyo template personalization. Custom code wise, you need to do something a bit different:

 

{% today '%Y-%m-%d' as today %} {{ today|format_date_string|date:'Y' }}

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

1 reply

telestrial
Problem Solver I
Forum|alt.badge.img+2
  • Author
  • Problem Solver I
  • 3 replies
  • Answer
  • January 25, 2024

The solution here: {% current_year %} is for in-klaviyo template personalization. Custom code wise, you need to do something a bit different:

 

{% today '%Y-%m-%d' as today %} {{ today|format_date_string|date:'Y' }}