# Anniversary filter not working

**URL:** <https://forum.mautic.org/t/anniversary-filter-not-working/19437>\
**Category:** Product Support\
**Created:** [May 12, 2021, 11:39am UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437 "2021-05-12T11:39:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [May 12, 2021, 11:39am UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/1 "2021-05-12T11:39:31Z")

</div>

**Your software**  
My Mautic version is: 3.3.2  
My PHP version is: 7.3.27  
My Database type and version is: MariaDB 10.5.8

**Your problem**  
My problem is: I’ve created a custom field “Date of Birth” and added values to some contacts and then created a segment using the “anniversary” filter option as per this thread:

> [@Birthday/Anniversary campaign](https://forum.mautic.org/t/birthday-anniversary-campaign/2615):
>
> Quite new to Mautic. I would like to set-up an birthday campaign. Purpose would be to select the leads that have their birthday & send them a personalised message. I tried creating a smart list, however don’t really see how I could add a this filter. I have birthday as a date type filed but there seems to be no possibility to compare this date with the current date to check if it’s the persons birthday. Am I missing something or is this function simply not available? Thanks, Dirk

However, the segment never has any contacts added to it. I have set some today day and month, but in past years and believe they should be added. This is what the filter looks like in the Mautic interface:

 ![Screenshot 2021-05-12 at 12.31.27](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e57f117a045adba49f6186f878ceddf513423ced.png)

I’ve tried running the segment update command manually, just to make sure it wasn’t the cron job not running, but that just gives the output:

```auto
Rebuilding contacts for segment 16
0 total contact(s) to be added in batches of 300
0 total contact(s) to be removed in batches of 300
0 contact(s) affected

```

Am I doing something wrong or is that previous thread wrong and this isn’t an option?

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [May 12, 2021, 1:32pm UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/2 "2021-05-12T13:32:27Z")

</div>

Looks like there is a Github issue for this regression already:

> <https://github.com/mautic/mautic/issues/9040>
>
> \[//\]: # ( Invisible comment: 
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII…I
> Before you create the issue:
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
> Search for similar report among other reported issues.
> Learn how to troubleshoot at https://www.mautic.org/docs/en/tips/troubleshooting.html
> Use drag&drop to attach images or other files )
> 
> \## Bug Description
> From support forum:
> https://forum.mautic.org/t/date-based-campaign/15418/3
> 
> When trying to setup a Birthday Campaign it does not seem to trigger correctly
> 
> These errors are showing in the log:
> None in System logs, none in /var/log/nginx/mautic.error log either
> 
> Steps I have tried to fix the problem:
> 
> Installed a clean version of Mautic-3.0.2.
> Added a custom field of type date - Date of Birth.
> 
> | Q | A
> | --- | ---
> | Mautic version | 3.0.2
> | PHP version | 7.2
> | Browser | 
> 
> \### Steps to reproduce
> 1. Add a user and user's birthday
> !\[image\](https://user-images.githubusercontent.com/42744161/88669083-1b791200-d0ec-11ea-973a-848ec5db1295.png)
> 
> 2. Created test campaign with a condition on contact field=Date of Birth and set date = anniversary
> !\[image\](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0666904d201da07eff84f58df731db7065ccb9e5.png)
> 3. Added an action to send an email on the positive path
> !\[image\](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/8627793403e3cca464173b24a33641bf838e68ae.png)
> Ran cronjob manually and not getting any email and this is what is shown in campaign conditions report:
> !\[image\](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/61950b609f0555e4c45a0fd92e8034f676d1fa1d.png)
> Today is the 28th July.
> \### Log errors
> 
> No error in logs neither through the UI or server logs.
> 
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/92161722-date-based-campaign-not-working?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 12, 2021, 1:37pm UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/3 "2021-05-12T13:37:01Z")

</div>

Hi there

Have you tried do do this inside a campaign rather, there is a condition on date with operator date and value anniversary

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [May 12, 2021, 1:39pm UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/4 "2021-05-12T13:39:07Z")

</div>

That wouldn’t work would it? The campaign triggers when someone is added to it and unless their birthday fell on the day they were added to the campaign, that would just fail the condition.

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [May 12, 2021, 1:39pm UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/5 "2021-05-12T13:39:42Z")

</div>

Anyone the “work around” on the github ticket is to use:

`anniversary +1 days`

instead and that works.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 13, 2021, 7:32am UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/6 "2021-05-13T07:32:36Z")

</div>

The way that I have done this in the past is by having my All segment coming into the campaign. Then having a condition on field value if DOB equals Anniversary, if yes then send e-mail, then after send email a jump event back to original condition, if no jump event after 1 day and back to original condition.

The only thing with this is it might turn into a very heavy campaign depending on your DB size, so you might want to have a separate cronjob just to run this campaign, this is done with the extension -1 [campaign id] for your update and trigger

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [May 13, 2021, 8:11am UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/7 "2021-05-13T08:11:46Z")

</div>

The segment seems to be working and only contains the contacts for that day and then using this segment in a campaign to send the email. I think overall this is a better approach and it is much less “work” for Mautic to do.

---

<div class="post-metadata">

**Author:** ![woutersf](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/woutersf/32/5453_2.png) [@woutersf](https://forum.mautic.org/u/woutersf)\
**Post date:** [February 16, 2022, 8:45am UTC](https://forum.mautic.org/t/anniversary-filter-not-working/19437/8 "2022-02-16T08:45:20Z")

</div>

We created a step by step guide for this.

> **[How to create a personalized birthday email in Mautic 4+](https://dropsolid.io/knowledge-hub/how-create-personalized-birthday-email-mautic-4)**
>
> Staying top of mind with your customers, partners and employees is more important than ever. Easy! With a fun and personalized email for every occasion.

Maybe this helps?
