Elgg
Version 2.3
|
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_get_notification_methods () | |
Returns registered delivery methods for notifications [ 'email' => 'email', 'sms' => 'sms', ] 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_smtp_default_message_id_header ($hook, $type, $returnvalue, $params) | |
Adds default Message-ID header to all e-mails. 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=0, $subject= '', $message= '', array $params=array(), $methods_override=null) | |
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... | |
Variables | |
return | function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
_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 193 of file notification.php.
_elgg_notifications_cron | ( | ) |
private
Definition at line 200 of file notification.php.
_elgg_notifications_init | ( | ) |
private
Definition at line 345 of file notification.php.
_elgg_notifications_smtp_default_message_id_header | ( | $hook, | |
$type, | |||
$returnvalue, | |||
$params | |||
) |
Adds default Message-ID header to all e-mails.
string | $hook | Equals to 'email' |
string | $type | Equals to 'system' |
array | $returnvalue | Array containing fields: 'to', 'from', 'subject', 'body', 'headers', 'params' |
array | $params | The same value as $returnvalue |
private
Definition at line 269 of file notification.php.
_elgg_notifications_test | ( | $hook, | |
$type, | |||
$tests | |||
) |
private
Definition at line 707 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 375 of file notification.php.
_elgg_save_notification_user_settings | ( | ) |
Save personal notification settings - input comes from request.
Definition at line 675 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 217 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 134 of file notification.php.
elgg_get_notification_methods | ( | ) |
Returns registered delivery methods for notifications [ 'email' => 'email', 'sms' => 'sms', ]
Definition at line 109 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 171 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 65 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 .
string | $name | The notification method name |
Definition at line 93 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 150 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 593 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 77 of file notification.php.
elgg_unregister_notification_method | ( | $name | ) |
Unregister a delivery method for notifications.
string | $name | The notification method name |
Definition at line 121 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 531 of file notification.php.
notify_user | ( | $to, | |
$from = 0 , |
|||
$subject = '' , |
|||
$message = '' , |
|||
array | $params = array() , |
||
$methods_override = null |
|||
) |
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 495 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 557 of file notification.php.
return function(\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
Definition at line 713 of file notification.php.