Loop on collections in the email body

Hi Everybody!

I need to do a loop on an array of collection in the body of my email.

Here my data recieved in the webhook :
{
“email”: [
my_email@gmail.com
],
“mail_type”: “portability_request_rejected_fr”,
“portability_desired_date”: “25/11/2024”,
“portability_reference”: “PIN202501020005425”,
“portability_rejected_reason”: [
{
“reason”: “Problème avec le mandat”,
“details”: “Le mandat n’est pas signé”
},
{
“reason”: “Problème avec la pièce justificative”,
“details”: “La pièce fournie ne contient pas le numéro de téléphone que vous souhaitez porter.”
}
]
}

In the body of my email i try to do this :

map({{1.portability_rejected_reason}}; reason)

This works, but I need to display both the reason and details. However, I can’t display both attributes of my collection on the same row.

Do you have any ideas, please?

Thanks a lot!

I finally succeeded. It was necessary to use an Iterator connected to the original collection array and then add a Text Aggregator module to specify the desired output format. In my case:

<tr>
    <td>{{2.iterator:number}}</td>
    <td>{{2.iterator:ndi}}</td>
    <td>{{2.iterator:rio}}</td>
    <td>{{2.iterator:analogic}}</td>
</tr>

Then, in the email-sending module, within the email body, I simply referenced my Text Aggregator like this:

<html>
    <body>
        <table>
            <tr>
                  <th>NUMBER</th>
                  <th>NDI</th>
                  <th>RIO</th>
                  <th>ANALOGIC</th>
           </tr>
           {{3.TextAgregator}}
        </table>
    </body>
</html>
1 Like