Support

Home Forums Event Espresso Premium Email to Admin when event is almost full or full

Email to Admin when event is almost full or full

Posted: September 12, 2014 at 8:04 am


Clair Mason

September 12, 2014 at 8:04 am

Hello everyone,

With out busy season starting this fall we need to add waiting lists to a large number of events. However adding a waiting list to every single event is too time consuming so I was wondering if there is a way to have EE send an email notification to the admin email when an event has 2 open spots remaining or even when an event becomes full.

If that is not possible I would like to add the something like [num_attendees_slash_reg_limit] short code to the admin email. So that I can see the number of open spots that way.

Thank you.


Sidney Harrell

September 12, 2014 at 11:25 am

There is a hook that fires when the attendee is added to the database, “action_hook_espresso_save_attendee_data”. You could use that to check how many spots are left, and fire off an email to the admin if appropriate. How we, you and the support team, get it done is dependent on your comfort level with php. If you are able to dig into it a bit, then we can help you out by pointing you in the right direction in the forums. If we need to code it up, then it would fall under a small customization that we could do on a couple support tokens. I’m not seeing an email shortcode that would give you the number of spots left available.


Clair Mason

September 12, 2014 at 12:41 pm

I have been learning php over the last year. I think I could dig into it a little bit. Please point me in the right direction.

Thank you.


Sidney Harrell

September 14, 2014 at 6:58 pm

Basically, you want to have a custom functions plugin like this: https://github.com/sidharrell/EE4custom/blob/master/CustomEE4FunctionsPlugin.php, which is just a file in your plugins folder where you can add a function and hook that function to an action or filter.
In your case, the add action line would be:

add_action('action_hook_espresso_save_attendee_data', 'fire_email_maybe');

and your function would look like:

function fire_email_maybe($attendee_data) {
    if (get_number_of_attendees_reg_limit($attendee_data['event_id'], 'number_available_spaces')<3) {
      // Fire off the email code here
    } 
}


Sidney Harrell

September 14, 2014 at 7:01 pm

Btw, there is a bug in the current version that affects using that hook when allowing additional attendees. In includes/process-registrations/add_attendees_to_db.php the line (572):

$ext_att_data_source['attendee_id'] = $attendee_id;

should be:

$ext_att_data_source['attendee_id'] = $ext_attendee_id;

It’s been fixed in the next version to be released.

The support post ‘Email to Admin when event is almost full or full’ 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