Engine/Notifications
From Elgg Documentation
Notifications
Events happen all the time in an Elgg system, whether triggered by a user or the system. In many cases notifications will get sent to a user or users, and all this is being handled by the extensible notifications system which also allows plugins to register additional notification handlers in addition to the default email handler (for example, an SMS or IM message).
The generic method to send a user a message in via notify_user(). This function will in turn notify all registered handlers and will pass them the necessary parameters. To register a notification handler, create a function for this which will need to get registered with register_notification_handler(). This function requires two parameters, the first is the notification type (for example sms), the second is the name of the newly created notification handler. An optional third parameter can be passed which is an array containing any configuration settings for the handler. Any array with values passed to notify_user() as an optional third parameter will get passed to the handler to further process.
A notification handler should accept three parameters, $from, $to, $subject, $message and an optional $params. $from will be a guid (so either a user, site, object or group) and $to will be the guid of a user or an array of users.
User preferences
The notification handler will take into consideration any user preferences on how to deliver the message. There is one option however to override the user's preferred delivery methods by passing a fourth parameter, containing a string or array of strings containing the delivery methods to use.
