on_user_add not working?

Permalink
OK, I have a need to receive an email when somebody registers for our extranet.
read some tidbits about hooking into the on_user_add event using a config/site_events.php file. i've created that file and added this to it:
<?php 
Events::extend('on_user_add', 
'ApplicationUser', 
'emailUser', 
'models/application_user.php');
?>

then I created models/application_user.php with the following:
class ApplicationUser {
   public function emailUser($ui) {
      echo 'mailer code here';
           return true;
   }
}

It never seems to hit the mailer code, which I removed here for simplicity. Like it's not even calling my function.
just upgraded to c5.2.0 too. I think I'm missing a step. anybody got a clue?

 
sdc53 replied on at Permalink Reply
needed to add:
define('ENABLE_APPLICATION_EVENTS', true);
to config/site.php

posting here so that others might save a few hours figuring out the problem.