• Introduction
  • Tutorial
  • User guide
  • SDK
  • Examples
  • Dynamic variables in templates

    All template fields (except for Template Name and Javascript ID) can contain dynamic variables, which are added by inserting the variable name, surrounded by double (or triple) curly brackets. For example – {{name}} or {{email}}. The dynamic variables are replaced with the values passed through the parameters object of the Javascript call. If the value of a certain variable is not passed, it will be replaced with an empty string.

    Variables added with double brackets are escaped by default, so if you pass “<b>bold</b>” as “message” variable, {{message}} will be replaced with “&lt;b&gt;bold&lt;/b&gt;”. If you want the variable to be injected without escaping (if HTML code is passed, for instance) use 3 brackets syntax, like this {{{html}}}.

    You can also use one of our built-in variables – user_os, user_platform, user_browser and user_version. Have a suggestion for additional built-in variables? Let us know!