# Segment with "Sent any email (Date)" condition

**URL:** <https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814>\
**Category:** Product Support\
**Created:** [April 25, 2023, 12:17pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814 "2023-04-25T12:17:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![suryakumar1](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@suryakumar1](https://forum.mautic.org/u/suryakumar1)\
**Post date:** [April 25, 2023, 12:17pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/1 "2023-04-25T12:17:53Z")

</div>

**Your software**  
My Mautic version is: v4.4.7  
My PHP version is:  
My Database type and version is:

**Your problem**  
My problem is:  
I have created a new user sign up segment with the criteria as follows:

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

The users are created in Mautic via an API (they are effectively pushed from our app to mautic).  
I’m unable to see any users populate in the campaign. This is owing to the last condition among the above 3 (as shown in the screenshot).

These errors are showing in the log:

Steps I have tried to investigate the problem:  
When I try to remove the condition “Sent any email (date) \< -1 day” then users are populating in the segment.  
I have never sent any email to the users, if that information helps with addressing the challenge.

---

<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:** [April 26, 2023, 9:06am UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/2 "2023-04-26T09:06:25Z")

</div>

Hi,  
The two segments are excluding each other:

1. Anyone who registered yesterday or today
2. AND anyone who got an email from your Mautic before yesterday.

Is this what you want?

---

<div class="post-metadata">

**Author:** ![suryakumar1](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@suryakumar1](https://forum.mautic.org/u/suryakumar1)\
**Post date:** [April 26, 2023, 12:09pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/3 "2023-04-26T12:09:48Z")

</div>

Hi @joeyk,

I am looking to satisfy 2 conditions:

1. Anyone who registered in the past 24hrs
2. AND the same person has not already been sent an email within the past 24hrs

Can you please help me understand how the above condition is best setup in Mautic?  
Thank you so much for your help.

Best Regards,  
Surya

---

<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:** [April 26, 2023, 1:34pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/4 "2023-04-26T13:34:30Z")

</div>

> [@suryakumar1](#):
>
> - Anyone who registered in the past 24hrs
> - AND the same person has not already been sent an email within the past 24hrs

Hi,

I would try this with 2 segments:

**Segment “Email in past 24 hours”:**  
Has sent an email in the past 24 hours:  
Sent any email (date) \< -1 day

**Segment “Fresh reg, no email”**  
Registered greater or equal -1 day  
AND  
segment membership exclude “Email in past 24 hours”

---

<div class="post-metadata">

**Author:** ![suryakumar1](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@suryakumar1](https://forum.mautic.org/u/suryakumar1)\
**Post date:** [April 26, 2023, 2:37pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/5 "2023-04-26T14:37:46Z")

</div>

Hi @joeyk

Thank you so much for your prompt response.  
To be more specific, if I am not mistaken, I should set the conditions as follows:

**Segment “Email in past 24 hours”:**  
Has sent an email in the past 24 hours:  
Sent any email (date) “_greater than_” -1 day

**Segment “Fresh reg, no email”**  
Registered greater or equal -1 day  
AND  
segment membership exclude “Email in past 24 hours”

Am I understanding this correctly?

Cheers,  
Surya

---

<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:** [April 26, 2023, 3:06pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/6 "2023-04-26T15:06:59Z")

</div>

Yes, that is right

---

<div class="post-metadata">

**Author:** ![suryakumar1](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@suryakumar1](https://forum.mautic.org/u/suryakumar1)\
**Post date:** [April 26, 2023, 3:23pm UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/7 "2023-04-26T15:23:16Z")

</div>

Thank you @joeyk  
The solution works well for our use-case.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [April 28, 2023, 3:23am UTC](https://forum.mautic.org/t/segment-with-sent-any-email-date-condition/27814/8 "2023-04-28T03:23:43Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
