Solved

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

  • 25 January 2024
  • 1 reply
  • 107 views

Badge +1

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!

icon

Best answer by telestrial 25 January 2024, 19:58

View original

1 reply

Badge +1

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' }}

Reply