1

Is there documentation anywhere for the email template syntax, specifically the available |[filter] options available for formatting values for display in an email?

I see in some of the example emails that they use a syntax of {{ var someVariable |raw }} -- what I'm looking for are what the things are after the '|' that are available, how I might add more and/or what the syntax (and code location) of those might be.

1

The scripting language inside email template is called Twig. According to Official Twig Documentation, the pipe symbol (|) inside delimiters(it means the {{}}) are "Filters". You can use it to modify the output.

Here is the list that you can use for the filter.

  • ahhh , thanks. I was wondering if that was something like Twig or something proprietary. (I couldn't even find any documentation that said that!) Greatly appreciated! – Scott Apr 12 '18 at 18:52
  • ok, I've tried |number_format, |number_format(2), number_format(2,'.',','), |round(2) -- none of them do anything to the value displayed – Scott Apr 12 '18 at 18:57
  • I didn't have a try on it. Usually I handle value filter before outputting to email template. – PY Yick Apr 13 '18 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.