Elgg
Version 1.9
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Activate a plugin or plugins. | |
Functions | |
elgg_register_notification_event ($object_type, $object_subtype, array $actions=array()) | |
Register a notification event. More... | |
elgg_unregister_notification_event ($object_type, $object_subtype) | |
Unregister a notification event. More... | |
elgg_register_notification_method ($name) | |
Register a delivery method for notifications. More... | |
elgg_unregister_notification_method ($name) | |
Unregister a delivery method for notifications. More... | |
elgg_add_subscription ($user_guid, $method, $target_guid) | |
Subscribe a user to notifications about a target entity. More... | |
elgg_remove_subscription ($user_guid, $method, $target_guid) | |
Unsubscribe a user to notifications about a target entity. More... | |
elgg_get_subscriptions_for_container ($container_guid) | |
Get the subscriptions for the content created inside this container. More... | |
_elgg_enqueue_notification_event ($action, $type, $object) | |
Queue a notification event for later handling. More... | |
_elgg_notifications_cron () | |
private More... | |
_elgg_send_email_notification ($hook, $type, $result, $params) | |
Send an email notification. More... | |
_elgg_notifications_init () | |
private More... | |
_elgg_notify_user ($to, $from, $subject, $message, array $params=null, $methods_override="") | |
Notify a user via their preferences. More... | |
notify_user ($to, $from, $subject, $message, array $params=array(), $methods_override="") | |
Notify a user via their preferences. More... | |
get_user_notification_settings ($user_guid=0) | |
Get the notification settings for a given user. More... | |
set_user_notification_setting ($user_guid, $method, $value) | |
Set a user notification pref. More... | |
elgg_send_email ($from, $to, $subject, $body, array $params=null) | |
Send an email to any email address. More... | |
_elgg_save_notification_user_settings () | |
Save personal notification settings - input comes from request. More... | |
_elgg_notifications_test ($hook, $type, $tests) | |
private More... | |
_elgg_enqueue_notification_event | ( | $action, | |
$type, | |||
$object | |||
) |
Queue a notification event for later handling.
Checks to see if this event has been registered for notifications. If so, it adds the event to a notification queue.
This function triggers the 'enqueue', 'notification' hook.
string | $action | The name of the action |
string | $type | The type of the object |
ElggData | $object | The object of the event |
Definition at line 171 of file notification.php.
_elgg_notifications_cron | ( | ) |
private
Definition at line 178 of file notification.php.
_elgg_notifications_init | ( | ) |
private
Definition at line 281 of file notification.php.
_elgg_notifications_test | ( | $hook, | |
$type, | |||
$tests | |||
) |
private
Definition at line 719 of file notification.php.
_elgg_notify_user | ( | $to, | |
$from, | |||
$subject, | |||
$message, | |||
array | $params = null , |
||
$methods_override = "" |
|||
) |
Notify a user via their preferences.
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. |
Definition at line 314 of file notification.php.
_elgg_save_notification_user_settings | ( | ) |
Save personal notification settings - input comes from request.
Definition at line 692 of file notification.php.
_elgg_send_email_notification | ( | $hook, | |
$type, | |||
$result, | |||
$params | |||
) |
Send an email notification.
string | $hook | Hook name |
string | $type | Hook type |
bool | $result | Has anyone sent a message yet? |
array | $params | Hook parameters |
Definition at line 195 of file notification.php.
elgg_add_subscription | ( | $user_guid, | |
$method, | |||
$target_guid | |||
) |
Subscribe a user to notifications about a target entity.
int | $user_guid | The GUID of the user to subscribe to notifications |
string | $method | The delivery method of the notifications |
int | $target_guid | The entity to receive notifications about |
Definition at line 112 of file notification.php.
elgg_get_subscriptions_for_container | ( | $container_guid | ) |
Get the subscriptions for the content created inside this container.
The return array is of the form:
array( <user guid>=""> => array('email', 'sms', 'ajax'), );
int | $container_guid | GUID of the entity acting as a container |
Definition at line 149 of file notification.php.
elgg_register_notification_event | ( | $object_type, | |
$object_subtype, | |||
array | $actions = array() |
||
) |
Register a notification event.
Elgg sends notifications for the items that have been registered with this function. For example, if you want notifications to be sent when a bookmark has been created or updated, call the function like this:
elgg_register_notification_event('object', 'bookmarks', array('create', 'update'));
string | $object_type | 'object', 'user', 'group', 'site' |
string | $object_subtype | The subtype or name of the entity |
array | $actions | Array of actions or empty array for the action event. An event is usually described by the first string passed to elgg_trigger_event(). Examples include 'create', 'update', and 'publish'. The default is 'create'. |
Definition at line 59 of file notification.php.
elgg_register_notification_method | ( | $name | ) |
Register a delivery method for notifications.
Register for the 'send', 'notification:[method name]' plugin hook to handle sending a notification. A notification object is in the params array for the hook with the key 'notification'. See Elgg_Notifications_Notification.
string | $name | The notification method name |
Definition at line 87 of file notification.php.
elgg_remove_subscription | ( | $user_guid, | |
$method, | |||
$target_guid | |||
) |
Unsubscribe a user to notifications about a target entity.
int | $user_guid | The GUID of the user to unsubscribe to notifications |
string | $method | The delivery method of the notifications to stop |
int | $target_guid | The entity to stop receiving notifications about |
Definition at line 128 of file notification.php.
elgg_send_email | ( | $from, | |
$to, | |||
$subject, | |||
$body, | |||
array | $params = null |
||
) |
Send an email to any email address.
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) |
NotificationException |
Definition at line 595 of file notification.php.
elgg_unregister_notification_event | ( | $object_type, | |
$object_subtype | |||
) |
Unregister a notification event.
string | $object_type | 'object', 'user', 'group', 'site' |
string | $object_subtype | The type of the entity |
Definition at line 71 of file notification.php.
elgg_unregister_notification_method | ( | $name | ) |
Unregister a delivery method for notifications.
string | $name | The notification method name |
Definition at line 99 of file notification.php.
get_user_notification_settings | ( | $user_guid = 0 | ) |
Get the notification settings for a given user.
int | $user_guid | The user id |
Definition at line 521 of file notification.php.
notify_user | ( | $to, | |
$from, | |||
$subject, | |||
$message, | |||
array | $params = array() , |
||
$methods_override = "" |
|||
) |
Notify a user via their preferences.
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. By default Elgg core supports three parameters, which give notification plugins more control over the notifications: object => null|ElggEntity|ElggAnnotation The object that is triggering the notification. action => null|string Word that describes the action that is triggering the notification (e.g. "create" or "update"). summary => null|string Summary that notification plugins can use alongside the notification title and body. |
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. |
NotificationException |
Definition at line 436 of file notification.php.
set_user_notification_setting | ( | $user_guid, | |
$method, | |||
$value | |||
) |
Set a user notification pref.
int | $user_guid | The user id. |
string | $method | The delivery method (eg. email) |
bool | $value | On(true) or off(false). |
Definition at line 562 of file notification.php.