I'm not sure how the email notifications work as I haven't looked into it, but I am familiar with hooking into events from a plugin...
Look at some plugins with an event_handler.php in its classes directory..
So basically in the plugins event handler, you assign the events you want to hook into, to a custom function you write...
Here a plugin binds to the mailbox plugin to be able to send push notifications on new messages:
public function genericInit() {
OW::getEventManager()->bind('mailbox.ping', array($this, 'sendNotification'));
}
This binds the sendNotification function to the mailbox.ping event so the sendNotification function executes along with anything else bound to that event.
Then some of the sendNotification function:
public function sendNotification( OW_Event $event )
{
$eventParams = $event->getParams();
$params = $eventParams['params'];
if ($eventParams['command'] == 'mailbox_api_ping')
{
return $this->onApiPing($event);
}
if ($eventParams['command'] != 'mailbox_ping')
{
return;
}
if ( !OW::getUser()->isAuthenticated() )
{
$event->setData(array('error'=>"You have to sign in"));
return;
}
Blah Blah Blah...
Command has been verified, User is Authenticated -> (Grab User?) Email Logic here
(Email command verification will be different from all this)
}
You'll likely need to reverse your specific event_handler to create your event handler and event function.
Here is the important part...
While you are developing, you're bound to break stuff and if you break something after binding to a certain event, it will break that event and all functions tied to it usually, until you get your function code fixed...
So don't panic if the event (emails?) stop working after you bind to the event and start coding your custom event function.
Just keep working through it to find and fix your bugs and chances are your event will start working again once everything in your custom function is right.