# Send segment email but exclude some users

**URL:** <https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960>\
**Category:** Product Support\
**Created:** [November 5, 2022, 12:10pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960 "2022-11-05T12:10:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 5, 2022, 12:10pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/1 "2022-11-05T12:10:44Z")

</div>

Hey i want to send segment email but exclude some user by some parameters like the way i can do that in a campaign.

As example let say i want to send am email for most of the segments but i want to filter it and send the email only to users that have more than 20 points.

Is that something that possible?  
Thanks

---

<div class="post-metadata">

**Author:** ![fabienne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fabienne/32/6256_2.png) [@fabienne](https://forum.mautic.org/u/fabienne)\
**Post date:** [November 8, 2022, 12:32pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/2 "2022-11-08T12:32:12Z")

</div>

Hey, I think you can solve this in different ways…  
I would recommend to make a new segment with the existing segment and use a filter for the points to create it. I recommend a new segment with two conditions. One “segment membership including xy” and Two - “points greater than 20”.  
Hope that helps.

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 8, 2022, 12:53pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/3 "2022-11-08T12:53:03Z")

</div>

Hey thanks for the good suggestion,

It’s a good idea but when you have like 20+ segments it’s going to make it a bit harder to duplicate all of them and create new segment for all. I think i might also need to change all the current funnles to insert the users to the new segments as well.

It might be a good idea maybe to make only one segment from all the existsting one, and make sure all funnels get the users to the new segment as well but it seems like a lot of work.

So it’s good suggestion but i hoped there will be a simpler one.  
Thanks again

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 4:11pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/4 "2022-11-08T16:11:20Z")

</div>

You create a new segment and include the all 20 segment by using filter in new segment then add a second filter to have point greater than 20.

No need to duplicate all 20+ segment … just filter it in the new segment in the filter setting

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 8, 2022, 4:28pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/5 "2022-11-08T16:28:14Z")

</div>

Hey thanks for your ansewr,  
How can you create segment and include inside 20 segments?

- And does your option keep updating new contacts added to all 20 segments? or do i need to recreate the segment each time?

- Also let say i have created filter and it excluded users with less than 20 points and i send email again after 1 month and than the user have more than 20 point but it was already excluded.  
So i guess that mean i have to recreate the segment each time to include users that were excluded right?

Thanks again

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 4:37pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/6 "2022-11-08T16:37:29Z")

</div>

Just go create a new segment just like how you create the other 20 segment.

In filter setting, add segment and include then select all the segments you want it to filtered  
and add a second filter for point then select greater than and input 20 .

If any other 20 segment contact has been changed (add / remove) it will already update the filtered segment.

Here an example screenshot of the filter segment that will only pull contacts from those 4 segments I included that have at least 20 or more points.

 ![Screenshot 2022-11-08 at 10.33.48 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/072623ecf063099879900f48f2b7b8b4a03720d7.jpeg)

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 4:51pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/7 "2022-11-08T16:51:02Z")

</div>

BTW …

I use tags instead of segment to maintain the contacts in filtered segments because in my world a contact can be a member in more than one categories, newsletters or events so I find it easier to maintain contact using tags.

Here an example of an upcoming events sending out invitation including contacts with any of those tags but excluding those contact that have the either already registered or unsubscribed tags

If contact registered for the event, they still will not lose the original tag and a registered tag will be added to them. Since that tag excludes them from receiving invitation so they will not get invitation email again

 ![Screenshot 2022-11-08 at 10.44.34 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/3607084cadc9b57c4a97ed870d13c96800a49958.jpeg)

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 8, 2022, 4:52pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/8 "2022-11-08T16:52:00Z")

</div>

Thank you, **are you sure something like that works?**  
If i do that it say there is no contacts on the segment.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/24f45cd993aa89be9a51d55664fabed670a8f726.png)

Also if i create a scheduled email with the new segment it also not showing pending emails when i choose the segment with all 20 segments.

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 4:58pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/9 "2022-11-08T16:58:47Z")

</div>

Are you running segment update via cronjob? How many minutes in between update?

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 5:06pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/10 "2022-11-08T17:06:35Z")

</div>

Here the link on more information about cronjob to update segments

> **[Cron jobs](https://docs.mautic.org/en/setup/cron-jobs)**
>
> . . . . Mautic 3 introduced a new path for cron jobs bin/console if you are using the legacy Mautic 2.x series you should replace this with the older version, app/console. . . . Mautic requires a few cron jobs to handle some maintenance tasks such as...

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 8, 2022, 5:07pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/11 "2022-11-08T17:07:12Z")

</div>

> [@techbill](#):
>
> Are you running segment update via cronjob? How many minutes in between update?

Yes, i have created my own cron script.  
The segment update script runnig each minute.

Is this the one that update the filters? **mautic:segments:update**  
I use that one on my code.

I normally not use filters so maybe there is other cron i am missing?

---

<div class="post-metadata">

**Author:** ![techbill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/techbill/32/8325_2.png) [@techbill](https://forum.mautic.org/u/techbill)\
**Post date:** [November 8, 2022, 5:09pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/12 "2022-11-08T17:09:18Z")

</div>

Go to CLI and type something like this

php /path/to/mautic/bin/console mautic:segments:update --no-interaction --no-ansi

It should display the result of the segment update.

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [November 8, 2022, 5:12pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/13 "2022-11-08T17:12:50Z")

</div>

Yes, you are right. It seems like the problem coming from my code and i will have to check that.

Thanks a lot,  
You been very helpful and you saved me a lot of time.

---

<div class="post-metadata">

**Author:** ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)\
**Post date:** [November 10, 2022, 8:59pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/14 "2022-11-10T20:59:11Z")

</div>

By the way, the new segment will be updated automatically, so no need to recreate it. All contacts that meet the criteria will be added or excluded from the segment. So a very good approach - I see it more transparent than ActiveCampaign.

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [November 15, 2022, 8:38am UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/15 "2022-11-15T08:38:24Z")

</div>

We have this feature implemented for segment emails.  
 ![Screen Shot 2022-11-15 at 09.35.06](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/08e5b3baedd627449407a03bd471585308314ed2.png)

We did not push it to the community yet as there is a long backlog of features and bug fixes that need testing in order to be merged to the product. Please [join the community with testing the open pull request](https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#testing) so pushing such features to the community is not a waste of time for the developers.

---

<div class="post-metadata">

**Author:** ![mara](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mara/32/6027_2.png) [@mara](https://forum.mautic.org/u/mara)\
**Post date:** [November 15, 2022, 10:24am UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/16 "2022-11-15T10:24:29Z")

</div>

That looks great! A customer of ours requested this too. So I think this is a very valuable feature for a lot of users. Thanks for working on that! 🌻

---

<div class="post-metadata">

**Author:** ![fedys](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fedys/32/11504_2.png) [@fedys](https://forum.mautic.org/u/fedys)\
**Post date:** [February 26, 2024, 1:24pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/17 "2024-02-26T13:24:53Z")

</div>

We just pushed the feature via [Added an option for excluding segments when creating/updating segment emails by fedys · Pull Request #13458 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/13458).

---

<div class="post-metadata">

**Author:** ![yochay11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yochay11/32/7301_2.png) [@yochay11](https://forum.mautic.org/u/yochay11)\
**Post date:** [February 26, 2024, 1:41pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/18 "2024-02-26T13:41:50Z")

</div>

That is amazing, thanks for the update

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [February 26, 2024, 2:26pm UTC](https://forum.mautic.org/t/send-segment-email-but-exclude-some-users/25960/19 "2024-02-26T14:26:24Z")

</div>

This is awesome!
