engine/lib/notification.php File Reference

Go to the source code of this file.

Namespaces

namespace  Elgg::Core
 

Activate a plugin or plugins.


Functions

 register_notification_handler ($method, $handler, $params=NULL)
 This function registers a handler for a given notification type (eg "email").
 unregister_notification_handler ($method)
 This function unregisters a handler for a given notification type (eg "email").
 notify_user ($to, $from, $subject, $message, array $params=NULL, $methods_override="")
 Notify a user via their preferences.
 get_user_notification_settings ($user_guid=0)
 Get the notification settings for a given user.
 set_user_notification_setting ($user_guid, $method, $value)
 Set a user notification pref.
 email_notify_handler (ElggEntity $from, ElggUser $to, $subject, $message, array $params=NULL)
 Send a notification via email.
 elgg_send_email ($from, $to, $subject, $body, array $params=NULL)
 Send an email to any email address.
 notification_init ()
 Correctly initialise notifications and register the email handler.
 notification_user_settings_save ()
 Includes the action to save user notifications.
 register_notification_object ($entity_type, $object_subtype, $language_name)
 Register an entity type and subtype to be eligible for notifications.
 register_notification_interest ($user_guid, $author_guid)
 Establish a 'notify' relationship between the user and a content author.
 remove_notification_interest ($user_guid, $author_guid)
 Remove a 'notify' relationship between the user and a content author.
 object_notifications ($event, $object_type, $object)
 Automatically triggered notification on 'create' events that looks at registered objects and attempts to send notifications to anybody who's interested.

Variables

global $NOTIFICATION_HANDLERS = array()
 Notification handlers.

Function Documentation

elgg_send_email ( from,
to,
subject,
body,
array $  params = NULL 
)

Send an email to any email address.

Parameters:
string $from Email address or string: "name <email>"
string $to Email address or string: "name <email>"
string $subject The subject of the message
string $body The message body
array $params Optional parameters (none used in this function)
Returns:
bool
Exceptions:
NotificationException 
Since:
1.7.2

Definition at line 296 of file notification.php.

email_notify_handler ( ElggEntity from,
ElggUser to,
subject,
message,
array $  params = NULL 
)

Send a notification via email.

Parameters:
ElggEntity $from The from user/site/object
ElggUser $to To which user?
string $subject The subject of the message.
string $message The message body
array $params Optional parameters (none taken in this instance)
Returns:
bool
Exceptions:
NotificationException private

Definition at line 244 of file notification.php.

get_user_notification_settings ( user_guid = 0  ) 

Get the notification settings for a given user.

Parameters:
int $user_guid The user id
Returns:
stdClass

Definition at line 170 of file notification.php.

notification_init (  ) 

Correctly initialise notifications and register the email handler.

Returns:
void private

Definition at line 371 of file notification.php.

notification_user_settings_save (  ) 

Includes the action to save user notifications.

Returns:
void

Definition at line 388 of file notification.php.

notify_user ( to,
from,
subject,
message,
array $  params = NULL,
methods_override = "" 
)

Notify a user via their preferences.

Parameters:
mixed $to Either a guid or an array of guid's to notify.
int $from GUID of the sender, which may be a user, site or object.
string $subject Message subject.
string $message Message body.
array $params Misc additional parameters specific to various methods.
mixed $methods_override A string, or an array of strings specifying the delivery methods to use - or leave blank for delivery using the user's chosen delivery methods.
Returns:
array Compound array of each delivery user/delivery method's success or failure.
Exceptions:
NotificationException 

Definition at line 88 of file notification.php.

object_notifications ( event,
object_type,
object 
)

Automatically triggered notification on 'create' events that looks at registered objects and attempts to send notifications to anybody who's interested.

See also:
register_notification_object
Parameters:
string $event create
string $object_type mixed
mixed $object The object created
Returns:
bool private

Definition at line 461 of file notification.php.

register_notification_handler ( method,
handler,
params = NULL 
)

This function registers a handler for a given notification type (eg "email").

Parameters:
string $method The method
string $handler The handler function, in the format "handler(ElggEntity $from, ElggUser $to, $subject, $message, array $params = NULL)". This function should return false on failure, and true/a tracking message ID on success.
array $params An associated array of other parameters for this handler defining some properties eg. supported msg length or rich text support.
Returns:
bool

Definition at line 38 of file notification.php.

register_notification_interest ( user_guid,
author_guid 
)

Establish a 'notify' relationship between the user and a content author.

Parameters:
int $user_guid The GUID of the user who wants to follow a user's content
int $author_guid The GUID of the user whose content the user wants to follow
Returns:
bool Depending on success

Definition at line 432 of file notification.php.

register_notification_object ( entity_type,
object_subtype,
language_name 
)

Register an entity type and subtype to be eligible for notifications.

Parameters:
string $entity_type The type of entity
string $object_subtype Its subtype
string $language_name Its localized notification string (eg "New blog post")
Returns:
void

Definition at line 403 of file notification.php.

remove_notification_interest ( user_guid,
author_guid 
)

Remove a 'notify' relationship between the user and a content author.

Parameters:
int $user_guid The GUID of the user who is following a user's content
int $author_guid The GUID of the user whose content the user wants to unfollow
Returns:
bool Depending on success

Definition at line 444 of file notification.php.

set_user_notification_setting ( user_guid,
method,
value 
)

Set a user notification pref.

Parameters:
int $user_guid The user id.
string $method The delivery method (eg. email)
bool $value On(true) or off(false).
Returns:
bool

Definition at line 211 of file notification.php.

unregister_notification_handler ( method  ) 

This function unregisters a handler for a given notification type (eg "email").

Parameters:
string $method The method
Returns:
void
Since:
1.7.1

Definition at line 65 of file notification.php.


Variable Documentation

$NOTIFICATION_HANDLERS = array()

Notification handlers.

Definition at line 22 of file notification.php.

 All Classes Namespaces Files Functions Variables Enumerations
Generated on Wed May 22 00:01:42 2013 for Elgg by  doxygen 1.6.3