Elgg
Version 6.1
|
Go to the source code of this file.
Functions | |
elgg_register_notification_event (string $object_type, string $object_subtype, array $actions=[], string $handler=NotificationEventHandler::class) | |
Register a notification event. More... | |
elgg_unregister_notification_event (string $object_type, string $object_subtype, array $actions=[]) | |
Unregister a notification event. More... | |
elgg_register_notification_method (string $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 (string $name) | |
Unregister a delivery method for notifications. More... | |
elgg_get_notification_events () | |
Get the registered notification events in the format. More... | |
elgg_get_subscriptions_for_container (int $container_guid) | |
Get the subscriptions for the content created inside this container. More... | |
notify_user (int|array $to, int $from=0, string $subject= '', string $message= '', array $params=[], $methods_override=null) | |
Notify a user via their preferences. More... | |
elgg_send_email (\Elgg\Email $email) | |
Send an email to any email address. More... | |
elgg_enqueue_notification_event (string $action,\ElggData $object,\ElggEntity $actor=null) | |
Enqueue a notification event for delivery. More... | |
elgg_enqueue_notification_event | ( | string | $action, |
\ElggData | $object, | ||
\ElggEntity | $actor = null |
||
) |
Enqueue a notification event for delivery.
Only use this function if the default event based queueing can't be used.
string | $action | the action of the notification event |
\ElggData | $object | the object used in the notification event |
\ElggEntity | $actor | (optional) the actor of the notification event (default: logged in user or owner of $object) |
Definition at line 256 of file notification.php.
elgg_get_notification_events | ( | ) |
Get the registered notification events in the format.
array ( <type> => array ( <subtype> => array ( <action1>, <action2>, ) ) )
Definition at line 153 of file notification.php.
elgg_get_notification_methods | ( | ) |
Returns registered delivery methods for notifications [ 'email' => 'email', 'sms' => 'sms', ]
Definition at line 121 of file notification.php.
elgg_get_subscriptions_for_container | ( | int | $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 | ( | string | $object_type, |
string | $object_subtype, | ||
array | $actions = [] , |
||
string | $handler = NotificationEventHandler::class |
||
) |
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'. |
string | $handler | NotificationEventHandler classname |
Definition at line 73 of file notification.php.
elgg_register_notification_method | ( | string | $name | ) |
Register a delivery method for notifications.
Register for the 'send', 'notification:[method name]' event to handle sending a notification. A notification object is in the params array for the event with the key 'notification'. See .
string | $name | The notification method name |
Definition at line 105 of file notification.php.
elgg_send_email | ( | \Elgg\Email | ) |
Send an email to any email address.
\Elgg\Email |
Definition at line 239 of file notification.php.
elgg_unregister_notification_event | ( | string | $object_type, |
string | $object_subtype, | ||
array | $actions = [] |
||
) |
Unregister a notification event.
string | $object_type | 'object', 'user', 'group', 'site' |
string | $object_subtype | The type of the entity |
array | $actions | The notification action to unregister, leave empty for all actions. Example ('create', 'delete', 'publish') |
Definition at line 88 of file notification.php.
elgg_unregister_notification_method | ( | string | $name | ) |
Unregister a delivery method for notifications.
string | $name | The notification method name |
Definition at line 134 of file notification.php.
notify_user | ( | int|array | $to, |
int | $from = 0 , |
||
string | $subject = '' , |
||
string | $message = '' , |
||
array | $params = [] , |
||
$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. |
Definition at line 201 of file notification.php.