Mautic Community Forums

Dynamic Variables

It would be really nice if “dynamic variables” would be added (you get the point of their name), like for example: current date, current time, current year (or any part of the date, meh) and so on. I want to put the current year in the footer of the email template and I either write it, or send it as token, which is kinda annoying. Thanks!

I would love to see that as well. Other Email Marketing Providers use a template engine like shopifies liquid.

This allows for basic conditional logic as well, for example:

{% if == ‘elvis’ %}
Hey Elvis
{% else %}
Hey Friend
{% endif %}

Beside that it comes with modifiers that work like this for example:

{{ ‘hello, world!’ | capitalize | remove: “world” }}

This would capitalize the “Hello, World” and remove the word “world”.

With that you can even do basic computing, for example, give me the next Monday from today in the format “Fri, Jul 17, 2015”:

{{ now | advance_to_next: “Monday” | date: “%a, %b %d, %y” }}