Dynamic copyright year in email template

Hi,

In the project I’m working on recently, I created an email template in Auth0 for password reset, which has a footer area like this:

<p>
    © 2021 CompanyName
</p>

I’m trying to make “2021” part dynamic based on the current timestamp so that I don’t have to go into Auth0 dashboard every year and hardcode the year (Likely I’ll forget to do it). Ideally I want to use a variable and make it like:

<p>
    © {{current_year}} CompanyName
</p>

However, this doesn’t seem to be possible from what is provided in templates:

Is this actually achievable? If not, what would be the best way to make the year dynamic?

Hi @shuhei.nakahodo

Since the email templates are based on the Liquid syntax, to get the current year you can do:

{{ “now” | date: “%Y” }}

You can also read more about the Liquid syntax here: Use Liquid Syntax in Email Templates

2 Likes

Thanks for helping on this one Ricardo!

@ricardo.batista Thanks for replying to this thread. The syntax is working for me as expected which is awesome! Thanks a lot for the help.

1 Like

Great! We are here for you!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.