Hi everyone,
I would need some help on the following:
General purpose: expose to Brevo API a list of ordered products (“ateliers” in following screenshots) on my website to be able to send an “order confirmation” email with all the products the user has bought (and metadata linked to each product such as “title”, “description”, …)
Challenge: I could not find a scalable methodology to transfer a variable nb of products list to Brevo API respecting its format guidelines
What I have done so far: I’m using the “trackEvent” endpoint, sending a Json with a “products” variable that host itself a list of dictionaries (Keyvalue pairs" defining each product). And on Brevo side, I’m using the “Reapeatable content” feature that detects the “products” variable and create a dynamic list of product with the right data to display.
That works well when I create an API call with a delimited list of products:
“eventdata”:{
“data”:{
“products”:[
{ “title”:“”,
“description”:“” },
{“title”:“”,
“description”:“”}
]
But I can’t find a way to create a dynamic list of dictionaries to pass to Brevo API in Bubble (that permits to pass a list of 1 product bought the same way as 5 products),
The closest way I reached is the following:
Creating a chain of “keyvaluepairs” hosted as URL parameter everytime the user add a product in his basket thanks to a Custom Event (see below where my product is named “ateliers”)
And pass it to a Repeating Group to create a list of “keyvalue” pairs:
And sending the following JSON
And, once populated with RG list, that results in the following:
“ateliers”:["{
titre:,
description:},
{…}
"]
which is not accepted by Brevo email template: I did not succeed in having the quote signs inside the curly braket (receiving an error from Bubble)
Hope I gave enough details. If not, feel free to ask for more.
Thank you very much in advance for any advice or idea you can have
Best,
Florent