# Q: How may I run something \*not after\* a date in campaign?

**URL:** https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190
**Category:** Product Support
**Created:** [March 7, 2024, 9:48pm UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190 "2024-03-07T21:48:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![donbowman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/donbowman/32/5702_2.png) [@donbowman](https://forum.mautic.org/u/donbowman)
#### Post date: [March 7, 2024, 9:48pm UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190/1 "2024-03-07T21:48:50Z")

</div>

**Your software**  
My Mautic version is: 4.4.11  
My PHP version is: 8.2  
My Database type and version is: tidb

**Your problem**

The tool tip for the dates in the conditions reminds us that “users added to the campaign will have this happen, regardless of whether the time is in the past”, suggesting unpublish the email as a workaround.

But, the campaign logic does not have an action to unpublish an email.

We just had the embarassign situation that some users were added to a segment that was announcing a webinar, and, they got all 4 invite emails back to back to back (just after it ended!)

I would like to express “Not before and not after” as date conditions. This is for time-oriented campaigns like a webinar.

I considered doing it w/ the sql condition, bt then i would need a separate one each time since it doesn’t take parameters (eg. select l.d from leads l where now() \<= sometime).

How may I achieve this objective?

---

<div class="post-metadata">

### Author: ![donbowman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/donbowman/32/5702_2.png) [@donbowman](https://forum.mautic.org/u/donbowman)
#### Post date: [March 8, 2024, 3:31am UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190/2 "2024-03-08T03:31:20Z")

</div>

so some discussion occurred [Unpublishing emails is not a good way to prevent scheduled emails from being sent · Issue #9285 · mautic/mautic · GitHub](https://github.com/mautic/mautic/issues/9285)

but it pivoted to what unpublish means and notification bells, rather than the underlying need, to have a deadline and cancel if afterwards.

---

<div class="post-metadata">

### Author: ![Dupre](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dupre/32/11704_2.png) [@Dupre](https://forum.mautic.org/u/Dupre)
#### Post date: [March 30, 2024, 2:33pm UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190/3 "2024-03-30T14:33:25Z")

</div>

I just signed up for the forum looking for this very thing. In my case, I set up a Black Friday sale and set it to start sending emails a couple of days before. First email immediately, then another shortly before the sale was ending. Then a couple of weeks later, I realized I never shut off the campaign and it was still sending the emails to new customers.

I can’t believe there isn’t a way to set dates for campaign start and end. Is there? I run a lot of campaigns and I wish I didn’t have to remember to turn off campaigns at the stroke of midnight when a sale ends.

---

<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: [March 30, 2024, 3:27pm UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190/4 "2024-03-30T15:27:33Z")

</div>

You can set expiry date for an email:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/3627ed58a8c5bf9fe91e1dc35f7ff1db5c812480.png)

And for the whole campaign too!

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

---

<div class="post-metadata">

### Author: ![Dupre](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dupre/32/11704_2.png) [@Dupre](https://forum.mautic.org/u/Dupre)
#### Post date: [March 30, 2024, 4:42pm UTC](https://forum.mautic.org/t/q-how-may-i-run-something-not-after-a-date-in-campaign/31190/5 "2024-03-30T16:42:50Z")

</div>

How the heck did I miss that!? Thank you, Joey! You just made my day!
