# Mail being sent to wrong person

**URL:** <https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438>\
**Category:** Ask for Help\
**Created:** [March 2, 2025, 11:33am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438 "2025-03-02T11:33:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorthe\_petersen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dorthe_petersen/32/71764_2.png) [@dorthe\_petersen](https://community.glideapps.com/u/dorthe_petersen)\
**Post date:** [March 2, 2025, 11:33am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/1 "2025-03-02T11:33:20Z")

</div>

I aim for an email to be sent to the owner when the first comment is posted and subsequently to everyone in the comment field when a new comment is posted.  
But the first comment is sent to the commenter instead of the owner.  
What am I doing wrong?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/d/2d10326041975f30a1abda6e6cece30c5a6ed59e.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/e/2ea43e0f1a36cc94dc40dafe24d7f1ea6218c577.png)

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [March 2, 2025, 1:00pm UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/2 "2025-03-02T13:00:35Z")

</div>

I don’t think that your configuration will be working fine with multiple comments from the same user.

## Here’s my solution idea

### Create a query column with these filters:

ID is this row → ID  
AND  
Commenter email is not this row → commenter email

### Create a joined list column for emails

Set the source to query column → commenter email.

### Create a template column

Set the template to: $commenters, $owner  
Replace:  
$commenters → joinedlist  
$owner → your owner lookup email column

That would make a joined list with owner email included.

### Create a Unique Elements column

Set the source to the template column.

In your workflow, remove the condition and keep only one send email. Set the emails to the unique elements column.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 3, 2025, 12:36am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/3 "2025-03-03T00:36:32Z")

</div>

When you say the “owner”, do you mean the person who posted the comment, or the one who “owns” the entity you are commenting on? I assume the second case?

---

<div class="post-metadata">

**Author:** ![dorthe\_petersen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dorthe_petersen/32/71764_2.png) [@dorthe\_petersen](https://community.glideapps.com/u/dorthe_petersen)\
**Post date:** [March 8, 2025, 9:42am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/4 "2025-03-08T09:42:52Z")

</div>

“owner” means the person who made the post being commented on

---

<div class="post-metadata">

**Author:** ![dorthe\_petersen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dorthe_petersen/32/71764_2.png) [@dorthe\_petersen](https://community.glideapps.com/u/dorthe_petersen)\
**Post date:** [March 8, 2025, 10:51am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/5 "2025-03-08T10:51:07Z")

</div>

I have tried this, but an email is still not sent to the owner.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/2/a2bacc67d4f621ff45270d47ee21ca6e09a2d1f5.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 8, 2025, 11:13pm UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/6 "2025-03-08T23:13:41Z")

</div>

Since you’re interacting with the Comments table, I think the logic should be:

- Add a relation column that relates the current comment’s “post ID” (so the parent entity) to itself, return multiple matches.
- Add a rollup to count the number of matches.
- If the count is 0, you send the email to the “owner”. Else send to your joined list of user emails.

---

<div class="post-metadata">

**Author:** ![dorthe\_petersen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dorthe_petersen/32/71764_2.png) [@dorthe\_petersen](https://community.glideapps.com/u/dorthe_petersen)\
**Post date:** [March 9, 2025, 10:26am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/7 "2025-03-09T10:26:11Z")

</div>

I’ve tried if-then-else as you suggested and if I’m viewing/logged in as a user and commenting on my own post as the first one, it works, but if I’m viewing/logged in as a user and commenting as the first one, it doesn’t work.  
I have tried testing with the owner commenting first (recipient of the email and the user replying to the first comment. Then they both receive an email and it is not intended that the user should receive an email when the user comments.  
Is it possible to set it up the way I want?  
I would prefer to avoid sending an email to the person who comments.  
NB. Made an array column, where the signed in user is removed from the “joined list” so that issue is solved:-)

Could I cheat it by having a row generated in the comments table when a post was made?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 9, 2025, 11:54pm UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/8 "2025-03-09T23:54:22Z")

</div>

> [@dorthe\_petersen](#):
>
> I’ve tried if-then-else as you suggested and if I’m viewing/logged in as a user and commenting on my own post as the first one, it works, but if I’m viewing/logged in as a user and commenting as the first one, it doesn’t work.

Can you show me in some screenshots how you set it up?

---

<div class="post-metadata">

**Author:** ![dorthe\_petersen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dorthe_petersen/32/71764_2.png) [@dorthe\_petersen](https://community.glideapps.com/u/dorthe_petersen)\
**Post date:** [March 10, 2025, 11:21am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/9 "2025-03-10T11:21:27Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/1/41cf70410dfe3542c9b0cddb5bf28891f7a4c456.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/d/7dc52c77ace41a33cded07f26d8480ece1578789.png)

have also tried with zero.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 10, 2025, 11:27am UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/10 "2025-03-10T11:27:19Z")

</div>

What’s the “remove duplicates” array?

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [March 10, 2025, 7:56pm UTC](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/11 "2025-03-10T19:56:10Z")

</div>

@dorthe_petersen did you try to implement this solution?

> [@Mail being sent to wrong person](https://community.glideapps.com/t/mail-being-sent-to-wrong-person/80438/2):
>
> I don’t think that your configuration will be working fine with multiple comments from the same user. Here’s my solution idea Create a query column with these filters: ID is this row → ID AND Commenter email is not this row → commenter email Create a joined list column for emails Set the source to query column → commenter email. Create a template column Set the template to: $commenters, $owner Replace: $commenters → joinedlist $owner → your owner lookup email column That would make a jo…
