Using Drupal 7.67 and CiviCRM 5.13.5.
We run volunteer inductions, and send an email to all people who have attended volunteer inductions (as per CiviEvent) after the induction. We only run inductions once a month, though there is sometimes a delay of a few days until our volunteer coordinator can send this email to induction attendees.
This is done through sending an email through CiviMail to a Smart Group. (We do it through CiviMail rather than through CiviEvent > Email all participants, because we want to see who opens the email and clicks on particular links).
The smart group has the following criteria:
- Group(s) = Attended volunteer induction - last 7 days ...AND...
- Group Status 'Added' ...AND...
- Event Type = Volunteer Induction ...AND...
- Start Date - greater than or equal to "4th July 2019 12.00 AM" ...AND...
- End Date - less than or equal to "10th July 2019 11.59 PM" ...AND...
- Participant Status (ID) In Attended ...AND...
- Participant is not a Test
We use the start date and end date to only select people who have attended a volunteer induction in the last 7 days (the actual group criteria we've configured is "event date: last 7 days including today").
We haven't had a volunteer induction in the last 7 days, apart from a test one I've just made in which there is only one attendee (me).
However I'm seeing huge discrepancies between the number of contacts that should be in the smart group (1 - just me, since the only Volunteer Induction event in the last 7 days is a test one I just made) and the number of contacts that a mailing would be sent to, in CiviMail.
Contacts > Manage Groups
This page shows 32 contacts are in the group (wrong).
From that page: "Contacts"
Clicking the "Contacts" link on the aforementioned page/the above screenshot, again shows that there are 32 contacts in the group (wrong).
"Edit Smart Group Criteria"
Clicking the "Edit Smart Group Criteria" page takes me to a new search page that shows there is only one contact in the smart group (the correct number of contacts!). I didn't actually edit any of the criteria, I only clicked the button and it shows me the correct number.
CiviMail recipients
However when I go to CiviMail and select the smart group as the recipient, it shows that it will be sent to 31 recipients (??) rather than 1. Looking into the recipients list, the 1 contact that should actually be in the smart group based on the criteria IS in the group, plus another 30 that may have previously met the criteria but don't anymore (based on attendance date).
--
This is pretty perplexing, does anyone know what's happening here? As I mentioned, the extra contacts who are showing up in the group are contacts who previously met the smart group criteria but don't anymore (they attended a volunteer induction a couple months ago, not in the last week).
I do wonder if it's because the smart group is referencing itself... in the criteria I pasted in at the top of this post, the first line seems to imply that contacts who are in the smart group, are ...in the smart group. But in screenshot 3 (under "edit smart group criteria"), that first criteria isn't there any more.