Sendgrid Send Mail to Multiple People with Multiple "Send To"

Hey guys,

I want to send multiple mails dynamically in my sendgrid module. But I couldn’t find the structure to do that. I also checked the Sendgrid API docs or checked the request with Integromat Dev Tools.

Do you know any solution? How the payload should look like?

{
    "from": {
        "name": "Projektleiter",
        "email": "example@gmail.com"
    },
    "template_id": "xxx",
    "json_or_values": "values",
    "personalizations": [
        {
            "to": [
                {
                    "name": "Onur",
                    "email": "example@gmail.com"
                },
                {
                    "name": "Onur2",
                    "email": "example@gmail.com"
                }
            ]
        }
    ]
}

I already tried couple of versions of this above.

Thank you for your help!

You might be able to aggregate the name+email address of each person as an array into that field.

Every result (item/record) from a iterator/search/match module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

Read this

The Array Aggregator module allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

Here is an example of using the “Target structure type” of an Array Aggregator module:

As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.

2 Likes

Hey @samliew ,

Thank you,

But I need to know the specific data structure of Sendgrid to map them into Sendgrid and send multiple mails.

Does anyone use Sendgrid in this way before?

Hey community!

Any answers?

You’ll have to put the array from the Array Aggregator module into your Sendgrid “Send to” field.

and you have to follow the above instructions to aggregate the emails to the Sendgrid “Send to” field, by selecting that field in the “Target structure type” in the Array Aggregator.

samliewrequest private consultation

2 Likes

@samliew thanks for your help but this is not what I’m looking for.

I’m looking for the specific array structure that Sendgrid’s “Send to” field needs. And I’m asking if anyone live this situation and if anyone know the specific structure to map dynamically the multiple receivers