# Send a batch of emails based on certain criteria

**URL:** <https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206>\
**Category:** Ask for Help\
**Created:** [September 26, 2022, 2:14pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206 "2022-09-26T14:14:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 26, 2022, 2:14pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/1 "2022-09-26T14:14:27Z")

</div>

Hey there, I’m wanting to send emails to a bunch of users everytime a certain interaction is done that matches their profile

Eg.

- There is bunch of surf sports, which surfers can follow. (I’ve completed this already)
- When a photographer uploads a photo, I want to notify all surfers that Follow that location, that an image is uploaded to their favourite location

Not sure how to send batch emails, it seems the Send Email function, only sends one at a time?  
Should I rather send an array of emails and names to Zapier or Make?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 26, 2022, 2:22pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/2 "2022-09-26T14:22:44Z")

</div>

> [@Gary\_Willmott](#):
>
> Should I rather send an array of emails and names to Zapier or Make?

That’s what I would do.

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 26, 2022, 2:27pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/3 "2022-09-26T14:27:43Z")

</div>

Thanks Darren, I would preferable like to send them to the correct page URL that the image is on? Is this possible?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 26, 2022, 2:43pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/4 "2022-09-26T14:43:38Z")

</div>

Yes. Assuming that you’ll be sending a Webhook, you can pass a link to the current screen as one of your webhook parameters:

![Screen Shot 2022-09-26 at 10.41.48 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/c/ccf69a0920d11b09836b9875b34f70b75fab191a.png)

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 26, 2022, 3:50pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/5 "2022-09-26T15:50:26Z")

</div>

@Darren_Murphy would you send a string of email addresses? or is it possible to send objects?

Just worried with email addresses, as I doubt you could personalize with first name etc?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 26, 2022, 4:07pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/6 "2022-09-26T16:07:25Z")

</div>

> [@Gary\_Willmott](#):
>
> @Darren_Murphy would you send a string of email addresses? or is it possible to send objects?

You could do either. With most of my webhooks I will send a JSON object. I like doing it this way as it means I’m just sending a single parameter. Then I use a Parse JSON module on the Make side to unpack it.

> [@Gary\_Willmott](#):
>
> Just worried with email addresses, as I doubt you could personalize with first name etc?

Yeah, that’s possible. I normally use templates on the Glide side to prepare the email subject line and email body, and then wrap it all up in a JSON object. So something like this:

```auto
{
  "email-body": "Hey {name}, a new pic has been added",
  "email-subject": "A new pic",
  "recipients": [
    {
      "name": "Mickey Mouse",
      "email": "mickey@disney.land"
    },
    {
      "name": "Donald Duck",
      "email": "donald@disney.land"
    }
  ]
}

```

And then on the Make side, you can replace `{name}` with the names from the recipients collection.

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 26, 2022, 4:31pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/7 "2022-09-26T16:31:31Z")

</div>

When you send a JSON object, do you send it as a lookup?  
 ![Screenshot 2022-09-26 at 18.28.36](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/c/bcabcb265d8cc518517a57488c926e6f1c3c6544.png)

And then to parse it on the Make side, I can’t get the value to come through

 ![Screenshot 2022-09-26 at 18.30.26](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0dcc8b159ac00ecdc1bd2d1b13d30a310d68be68.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 27, 2022, 12:06am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/8 "2022-09-27T00:06:50Z")

</div>

I see that you found my [mini-tutorial](https://community.glideapps.com/t/send-data-using-api/49724/4) on creating a JSON object - did that get you what you need?

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 27, 2022, 6:54am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/9 "2022-09-27T06:54:05Z")

</div>

Thanks this is really helpful, however I’m struggling to get the parsing JSON right in Make  
I went through this [JSON](https://www.make.com/en/help/tools/json) however I just can’t get it right. Do you perhaps have a tutorial on parsing JSON through Make?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 27, 2022, 8:54am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/10 "2022-09-27T08:54:51Z")

</div>



---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 27, 2022, 4:56pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/11 "2022-09-27T16:56:24Z")

</div>

Hey Darren, this is super helpful, going to try this once Make has survived their DDOS attach 🙈

The [mini tutorial on creating JSON is incredible](https://community.glideapps.com/t/send-data-using-api/49724/4)

However I don’t understand how I would only pull the values I need?  
I created a lookup to the column and it’s pulling all users, I only need the users that follow that location?

 ![Screenshot 2022-09-27 at 18.54.04](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/f/2f3abcb49861d3712e68e93ccc43c86f21f2d65a.jpeg)  
 ![Screenshot 2022-09-27 at 18.53.56](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0ef938b63f15767b421107cc2df8d24f4cd82621.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 27, 2022, 5:00pm UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/12 "2022-09-27T17:00:48Z")

</div>

> [@Gary\_Willmott](#):
>
> However I don’t understand how I would only pull the values I need?  
> I created a lookup to the column and it’s pulling all users, I only need the users that follow that location?

To get a filtered list, you would first need to create a multiple relation that matches all the rows you need, and then (I would think) a joined list rather than a lookup through that relation.

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 29, 2022, 7:16am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/13 "2022-09-29T07:16:43Z")

</div>

Hey @Darren_Murphy I noticed something strange is happening, wonder if you can assist?

The Json is getting sent with double ""s like this below. This is what happens when I copy the output from the window, however the preview looks fine?

```auto
"{
    ""name"": ""Gary Willmott"",
    ""email"": ""garythewillmott@gmail.com""
}"

```

I don’t understand as this is how I setup my template

 ![Screenshot 2022-09-29 at 09.13.18](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/2/f2702b14eaeb873990cf1551053cf2b359a42a9c.png)

And this is what the preview looks like  
 ![Screenshot 2022-09-29 at 09.13.23](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0ebd2004e966c7ab1ed6fbd55d3d37a0223dc727.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 29, 2022, 7:36am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/14 "2022-09-29T07:36:09Z")

</div>

Might be easier if I jump in and have a quick look - is that okay?

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 29, 2022, 8:31am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/15 "2022-09-29T08:31:39Z")

</div>

Yeh go for it, you should still have access

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 29, 2022, 9:15am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/16 "2022-09-29T09:15:07Z")

</div>

Okay, will take a look shortly

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 29, 2022, 9:37am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/17 "2022-09-29T09:37:23Z")

</div>

@Gary_Willmott - just had a quick look and all looks okay. I did notice that your `JSON/payload` column isn’t used anywhere. I would expect that one to be sent through your webhook.

So, when you say…

> [@Gary\_Willmott](#):
>
> The Json is getting sent with double ""s like this below. This is what happens when I copy the output from the window, however the preview looks fine?
> 
> ```auto
> "{
> ""name"": ""Gary Willmott"",
> ""email"": ""garythewillmott@gmail.com""
> }"
> 
> ```

Where exactly are you seeing that?

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 29, 2022, 9:50am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/18 "2022-09-29T09:50:29Z")

</div>

I noticed it when I send it to Make, I [actually logged a ticker on their community too, as I’m struggling with parsing](https://community.make.com/t/sending-one-gmail-to-multiple-recipients-email-addresses-extracted-from-a-text/3303/8?u=gary)

I noticed this morning after writing it, there is double “” in the JSON I’m parsin

You can test it by going to the demo button action

1. Make sure you are logged in as me (admin)
2. Click on any image (pref the one in Trestles, as I’m the only follower there)  
You will see the button

 ![Screenshot 2022-09-29 at 11.49.19](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/5/3599a68f3e29db6a7fed7bd7849b2e646fb0779c.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 29, 2022, 9:55am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/19 "2022-09-29T09:55:51Z")

</div>

Okay, I see it, and yes it looks fine in Glide.  
So must be something funny going on at the Make end.  
Can you give me temporary access to your Make account?

---

<div class="post-metadata">

**Author:** ![Gary\_Willmott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gary_willmott/32/837_2.png) [@Gary\_Willmott](https://community.glideapps.com/u/Gary_Willmott)\
**Post date:** [September 29, 2022, 10:05am UTC](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206/20 "2022-09-29T10:05:39Z")

</div>

Will PM you

[Next page](https://community.glideapps.com/t/send-a-batch-of-emails-based-on-certain-criteria/50206.md?page=2)
