I'm trying to create a Mailjet template with an array of flat objects. But during my tests, Mailjet send me this kind of error:
expression parsing error ## Unknown identifier: session.name ## near ## {{session.name ##
For details, below my current template:
<table class="result">
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>details</th>
</tr>
</thead>
<tbody>
{% for session in var:result.sessions %}
<tr>
<td>{{session.name}}</td>
<td>
{% if session.status == "Error" %}
<span class="error-icon"/>
{% else %}
<span class="success-icon"/>
{% endif %}
</td>
<td>{{session.details}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if var:result.error != "" %}
<span>Erreur during the process : {{var:result.error}}</span>
{% endif %}
And below, the variables I try to pass during my test:
{
"Variables":
{
"result":
{
"error": "An error occurred foo bar blabla",
"sessions": [
{
"name": "A nice session",
"status": "Error",
"details": "This session is broken"
}
]
}
}
}
I even tried to use <mj-raw>
tags around my mjml markups, but it changes nothing.
I've tested my template by curl request and with my account's Mailjet sandbox.
Have you got an idea?