# Trigger Campaign Based on Date/Time

**URL:** https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262
**Category:** Development
**Created:** [October 17, 2016, 8:55pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262 "2016-10-17T20:55:18Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![mattk](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mattk](https://forum.mautic.org/u/mattk)
#### Post date: [October 17, 2016, 8:55pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/1 "2016-10-17T20:55:18Z")

</div>

Has anyone been able to successfully find a way to trigger a campaign action based on a date/time field in the DB?  
  
  
  
My business case is essentially the below:  
  
  
  
A user books an appointment for a specific date/time. We would like to send a notification (i.e. reminder) the day before their scheduled appointment. This would essentially need to compare the current date/time to the date/time on the record.  
  
  
  
Thoughts?  
  
  
  
Also, if this isn’t available we’ll probably end up building out something like this - would anyone be interested in using a solution like this?

---

<div class="post-metadata">

### Author: ![mattk](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mattk](https://forum.mautic.org/u/mattk)
#### Post date: [October 17, 2016, 8:55pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/2 "2016-10-17T20:55:18Z")

</div>

Has anyone been able to successfully find a way to trigger a campaign action based on a date/time field in the DB?

My business case is essentially the below:

A user books an appointment for a specific date/time. We would like to send a notification (i.e. reminder) the day before their scheduled appointment. This would essentially need to compare the current date/time to the date/time on the record.

Thoughts?

Also, if this isn’t available we’ll probably end up building out something like this - would anyone be interested in using a solution like this?

---

<div class="post-metadata">

### Author: ![Elenchus](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Elenchus](https://forum.mautic.org/u/Elenchus)
#### Post date: [October 17, 2016, 10:00pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/3 "2016-10-17T22:00:20Z")

</div>

I can’t see a simple way to do this, but I’d certainly be interested in hearing if you find/create one

---

<div class="post-metadata">

### Author: ![Ethan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ethan/32/177_2.png) [@Ethan](https://forum.mautic.org/u/Ethan)
#### Post date: [April 19, 2017, 9:31pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/4 "2017-04-19T21:31:36Z")

</div>

Yes I would use this feature if it were available.

---

<div class="post-metadata">

### Author: ![shanef](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@shanef](https://forum.mautic.org/u/shanef)
#### Post date: [April 23, 2017, 9:23am UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/5 "2017-04-23T09:23:59Z")

</div>

Great idea!! will use it!!

---

<div class="post-metadata">

### Author: ![seedofabraham](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@seedofabraham](https://forum.mautic.org/u/seedofabraham)
#### Post date: [July 11, 2017, 4:21pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/6 "2017-07-11T16:21:16Z")

</div>

I have not used this yet but it looks promising:

[https://github.com/thirdset/ThirdSetMauticTimingBundle/blob/master/README.md](https://github.com/thirdset/ThirdSetMauticTimingBundle/blob/master/README.md)

@balkee listed a great solution, too:

[https://www.mautic.org/community/index.php/2771-sending-campaign-emails-during-specific-hours/0](https://www.mautic.org/community/index.php/2771-sending-campaign-emails-during-specific-hours/0)

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [July 12, 2017, 6:02am UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/7 "2017-07-12T06:02:28Z")

</div>

Create a segment with a filter like `[appointment date field] equals tomorrow`. Use this segment to feed a campaign with the reminder. One day before the appointment date, the contact is added dynamically to the segment and the reminder email is sent out.

Limitations:

- The reminder email will be sent out when the day changes (midnight)
- AFAIK the filter value accepts only “today”, “tomorrow”, “yesterday” - in your described case it is fine buf if you want to remind 2 days in advance you would need something like “today+2” which I could not test positively

---

<div class="post-metadata">

### Author: ![seedofabraham](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@seedofabraham](https://forum.mautic.org/u/seedofabraham)
#### Post date: [July 17, 2017, 2:01am UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/8 "2017-07-17T02:01:33Z")

</div>

very creative @PeterTL!

---

<div class="post-metadata">

### Author: ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)
#### Post date: [July 17, 2017, 4:48am UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/9 "2017-07-17T04:48:55Z")

</div>

> [@24337:@seedofabraham](#):
>
> very creative @PeterTL!

I take that as a compliment!

---

<div class="post-metadata">

### Author: ![seedofabraham](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@seedofabraham](https://forum.mautic.org/u/seedofabraham)
#### Post date: [July 17, 2017, 5:39pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/10 "2017-07-17T17:39:38Z")

</div>

> [@24341:@PeterTL](#):
>
> I take that as a compliment!

As you should, my fellow Mautic brother.

---

<div class="post-metadata">

### Author: ![rodrake](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rodrake](https://forum.mautic.org/u/rodrake)
#### Post date: [November 25, 2017, 6:40pm UTC](https://forum.mautic.org/t/trigger-campaign-based-on-date-time/6262/11 "2017-11-25T18:40:37Z")

</div>

I tryed this solution, but unfortunately, it doesn’t take in consideration time, only date. So if you need something to happen on a specific date/time custom field, it won’t work.
