Support

Home Forums Event Espresso Premium EE4: Changing event admin email notification behaviour

EE4: Changing event admin email notification behaviour

Posted: January 27, 2015 at 11:12 am


emarienborg

January 27, 2015 at 11:12 am

Hi!

I’m currently migrating an EE3 site on to Event Espresso 4 (4.5.0.beta32).

In EE3 I managed to change a core file so that the event admin only got an email notification upon registration if a certain question in the registration form (“Messages to the event admin”) was filled out.

In EE4, I can’t even find the right place to look.. Where is the email to event admin upon registration fired from?

I know you recommend against changing core files, but on this matter I have no choice in order to make my client satisfied. I also make sure to make small changes so that keeping the core files updated is a small problem. (I create a function in my functions.php that do the actual work of checking if the send conditions are met, the only change made to the EE core files are a call to that function and an if-statement checking if true or false was returned.)

Any help appriciated. Thanks.

Eivind

  • This topic was modified 9 years, 3 months ago by  Tony. Reason: Moved to premium


Sidney Harrell

January 30, 2015 at 1:08 pm

You’ll want to take a look at the actions and filters at the top of the file modules/messages/EED_Messages.module.php.
What you can do is hook your function to those same hooks, but with a higher precendence order. That way you can take a look at the registration and determine whether you want to un-hook the standard EE method in some circumstance.
Doing it that way, you shouldn’t have to make any core modifications. If you do need developer hooks added at some point, though, let us know. A pull request through our github repo is probably the best way to go about it.


emarienborg

January 31, 2015 at 4:17 am

Thanks for your reply!

I couldn’t manage to make my own function run instead of yours, so I’m stuck with altering core code again. But that’s okay.

I’ve assumed the relevant function is the maybe_registration function, since that is the function I would’ve been able to hook into.

I need to send the email to the registered attendee, but not to the event admin. As I’m working my way through that function, I realize that I might not be in the right place? There’s nothing in that function that’s looping through both attendee and admin, allowing me to halt the sending to the admin, is there?

If not, where does that happen?

Thanks again!

Eivind


Josh

  • Support Staff

February 3, 2015 at 8:30 am

Hello Eivind,

I’m not quite sure I’m following your logic, but if you look at the maybe_registration() method, you’ll see where it does this:

if ( EEH_MSG_Template::is_mt_active( $message_type )) {

is_mt_active returns an array of active types. That might be a good place to add another conditional, but please do not hack the core method. You can unhook this via the AHEE__EE_Registration_Processor__trigger_registration_update_notifications action hook. Along with that, there is also a filter hook that might work for you as well:
FHEE__EE_Registration_Processor__trigger_registration_update_notifications__additional_conditions

The support post ‘EE4: Changing event admin email notification behaviour’ 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