Recently attendees of canceled events have reported receiving emails when the admin sends out a message to event attendees. This was before I made any updates to the site, which I did when I started investigating, hoping plugin updates would help but, no luck. Any idea what may be happening there?
A strange thing started happening when using the “Email Attendees” function for an event… Up until a few weeks ago it worked perfect—with EE having been installed for over a year. But then users that had cancelled their registration for an event reported they were receiving the emails sent out to the attendees of that event. Any idea why that may be occurring? I haven’t made any updates to the site recently so it seems odd.
It looks like the function that controls this send the email to all attendees, regardless of status. I’ll raise a ticket to see if we can change this or add in a filter to allow for modification.
The function that sets up the event reminder emails is pluggable. This means you can copy the entire function then paste it into a custom functions file (like in your theme or another plugin). As long as your theme loads first, it will run instead of the core function. As an aside, EE3 checks in /wp-content/uploads/espresso/custom_functions.php first, so that’s another place where you can add your custom function.
So if you want to make it so Cancelled registrations aren’t included when the event reminder is sent, you can make an edit to the query where it pulls all the registered attendees for an event. Here’s some example code that shows how to exclude those cancelled registrations:
$SQL = 'SELECT * FROM ' . EVENTS_ATTENDEE_TABLE . ' WHERE event_id =%d AND payment_status !=%s GROUP BY lname, fname';
$attendees = $wpdb->get_results( $wpdb->prepare( $SQL, $event_id, 'Cancelled' ));
Awesome, thank you so much Josh. I inserted the example code into the Reminder Notices function in a new custom functions file and it works perfect after a few tests.
Viewing 3 reply threads
The support post ‘Canceled Attendees Still Receiving Emails About Event in EE3’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.