email=="")) throw new NotificationException(sprintf(elgg_echo('NotificationException:NoEmailAddress'), $to_guid)); $to = $entity->email; $subject = $params['subject']; $from = $params['from']; $headers = "From: $from\r\n"; return mail($to, $subject, $message, $headers); } /** * Correctly initialise notifications and register the email handler. * */ function notification_init() { register_notification_handler("email", "email_notify_handler"); } // Register a startup event register_elgg_event_handler('init','system','notification_init',0); ?>