Shopify post request for loop

Viewed 15

I am trying to configure an abandoned checkout marketing automation with shopify Flow, that sends a POST request to an external email marketing platform (namely sendinblue):

Shopify flow screeshot

I am able to pass basic parameters and shopify variables such as currency. The issue I have is with looping through items in the shopping cart.

Does the body of the request accepts for/in loops or it does accept only JSON ?

Here is my code

 {
     "to": [
          {
               "email": "test@test.com",
               "name": "John Doe"
          }
     ],
     "params": {
          "currency": "eur",
          "total": "",
"items":[{
"name":"{% for productsAddedToCart_item in abandonment.productsAddedToCart %}
  {{productsAddedToCart_item.product.title}}
{% endfor %}"
}]
     },
     "templateId": 26
}

Thanks in advance for your hints!

0 Answers
Related