Dynamic variables, also known as placeholders, are used to represent dynamic data in your templates. When rendering a template, we will replace the placeholders with your data.
We are rendering templates using the Twig templating engine.
Placeholders are defined using double curly braces {{ variableName }}
.
You can use any name for the variable.
Naming rules:
{{ name }}
and {{ Name }}
are different variables.These variables can be replaced with the data you passed in the request JSON body when rendering the template through the API. More information about rendering templates can be found in the Render template section.
Below, you can see a general example:
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My template</title>
</head>
<body>
<h1>Contact form request from web</h1>
<p>Name: {{ name }}</p>
<p>Email: {{ email }}</p>
<p><b>Topics:</b></p>
<ul>
{% for topic in topics %}
<li>{{ topic }}</li>
{% endfor %}
</ul>
{% if text %}
<p>Text:</p>
<p><i>{{ text }}</i></p>
{% endif %}
</body>
</html>