mrml icon indicating copy to clipboard operation
mrml copied to clipboard

Is for loop supported ?

Open Madko opened this issue 2 years ago • 2 comments

Hi,

I've tried something like:

        <mj-raw>{% for resource in resources %}</mj-raw>
        <mj-text>
                Ressource: {{ resource }}
        </mj-text>
        <mj-raw>{% endfor %}</mj-raw>

then:

curl -X POST -v \ 
  -H "Content-Type: application/json" \
  --data '{"from":"EMAIL","to":"EMAIL","params":{"name": "Edouard", "resources":["01","02"], "token":"TOKEN_DATA"}}' \
  http://localhost:3000/templates/test

with no luck. Is there a way to make simple loops in mjml ?

best regards

Madko avatar May 04 '22 13:05 Madko

Hello, I have similar question too. Is this supported?

suplere avatar Nov 20 '22 11:11 suplere

@Madko did you try without the <mj-raw>?

jdrouet avatar Nov 20 '22 13:11 jdrouet

No answers for more than a year, closing this

jdrouet avatar Apr 13 '24 13:04 jdrouet