Support

Home Forums Event Espresso Premium Canceled Attendees Still Receiving Emails About Event in EE3

Canceled Attendees Still Receiving Emails About Event in EE3

Posted: March 22, 2015 at 6:59 pm


Trevis

March 22, 2015 at 6:59 pm

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?

Thank you!


Trevis

March 22, 2015 at 6:59 pm

Hello-

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.

Thank you!


Dean

March 30, 2015 at 4:10 am

Hi,

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.


Josh

  • Support Staff

March 30, 2015 at 2:20 pm

Hi Trevis,

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' ));


Trevis

March 30, 2015 at 3:53 pm

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.

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.

Event Espresso