Elgg
Version 6.3
|
Notification Event Handler handles preparation of a notification. More...
Public Member Functions | |
__construct (protected NotificationEvent $event, protected NotificationsService $service, array $params=[]) | |
Constructor. More... | |
send () | |
Process the event. More... | |
getSubscriptions () | |
Returns subscriptions for the event. More... | |
getMethods () | |
Returns methods to be used for this notification. More... | |
Static Public Member Functions | |
static | isConfigurableByUser () |
Is this event configurable by the user on the notification settings page. More... | |
static | isConfigurableForEntity (\ElggEntity $entity) |
Can this event be configured for a specific entity. More... | |
Protected Member Functions | |
setMethodsOverride (array $methods) | |
Override the default user preferred delivery methods with the given methods. More... | |
getMethodsOverride () | |
Get the delivery methods override. More... | |
getNotificationMethods () | |
Get the notification methods to use. More... | |
prepareSubscriptions () | |
Returns subscriptions. More... | |
filterMutedSubscriptions () | |
Should muted subscribers be filtered. More... | |
getNotificationSubsciptionExclusionGUIDs () | |
Get an array of GUIDs to not get the subscription records for. More... | |
excludeOwnerSubscribers () | |
Exclude the NotificationEvent object owner_guid when fetching the subscription records for this notification. More... | |
excludeContainerSubscribers () | |
Exclude the NotificationEvent object container_guid when fetching the subscription records for this notification. More... | |
excludeEntitySubscribers () | |
Exclude the NotificationEvent object guid when fetching the subscription records for this notification. More... | |
sendNotifications (array $subscriptions, array $params=[]) | |
Sends the notifications based on subscriptions. More... | |
sendNotification (\ElggEntity $recipient, string $method, array $params=[]) | |
Send a notification to a subscriber. More... | |
deliverNotification (Notification $notification, string $method) | |
Deliver a notification. More... | |
prepareNotification (array $params) | |
Prepares a notification for delivery. More... | |
getNotificationSubject (\ElggUser $recipient, string $method) | |
Get subject for the notification. More... | |
getNotificationBody (\ElggUser $recipient, string $method) | |
Get body for the notification. More... | |
getNotificationSummary (\ElggUser $recipient, string $method) | |
Return the summary for a notification. More... | |
getNotificationURL (\ElggUser $recipient, string $method) | |
Returns the url related to this notification. More... | |
getNotificationAttachments (\ElggUser $recipient, string $method) | |
Get the attachments for this notification. More... | |
getEventActor () | |
Get the acting user from the notification event. More... | |
getEventEntity () | |
Get the entity from the notification event. More... | |
addMuteLink () | |
Add a mute link in the email notification. More... | |
getParam (string $param, mixed $default=null) | |
Get a parameter from the notification parameters. More... | |
Static Protected Member Functions | |
static | isConfigurableForUser (\ElggUser $user) |
Can this event be configured for a specific user. More... | |
static | isConfigurableForGroup (\ElggGroup $group) |
Can this event be configured for a specific group. More... | |
Protected Attributes | |
array | $params = [] |
array | $methods_override = [] |
Notification Event Handler handles preparation of a notification.
Definition at line 14 of file NotificationEventHandler.php.
Elgg\Notifications\NotificationEventHandler::__construct | ( | protected NotificationEvent | $event, |
protected NotificationsService | $service, | ||
array | $params = [] |
||
) |
Constructor.
NotificationEvent | $event | event to handle |
NotificationsService | $service | service that handles the events |
array | $params | additional params for event handling |
Definition at line 35 of file NotificationEventHandler.php.
|
protected |
Add a mute link in the email notification.
Reimplemented in Elgg\Notifications\UnbanUserEventHandler, Elgg\Notifications\RemoveAdminUserEventHandler, Elgg\Notifications\MentionsEventHandler, Elgg\Notifications\MakeAdminUserEventHandler, and Elgg\Notifications\InstantNotificationEventHandler.
Definition at line 588 of file NotificationEventHandler.php.
|
finalprotected |
Deliver a notification.
Notification | $notification | Notification to deliver |
string | $method | Method to use for delivery |
Definition at line 333 of file NotificationEventHandler.php.
|
protected |
Exclude the NotificationEvent object container_guid when fetching the subscription records for this notification.
Definition at line 185 of file NotificationEventHandler.php.
|
protected |
Exclude the NotificationEvent object guid when fetching the subscription records for this notification.
Definition at line 195 of file NotificationEventHandler.php.
|
protected |
Exclude the NotificationEvent object owner_guid when fetching the subscription records for this notification.
Reimplemented in Elgg\Notifications\CreateCommentEventHandler.
Definition at line 175 of file NotificationEventHandler.php.
|
protected |
Should muted subscribers be filtered.
Reimplemented in Elgg\Notifications\InstantNotificationEventHandler.
Definition at line 129 of file NotificationEventHandler.php.
|
protected |
Get the acting user from the notification event.
Definition at line 510 of file NotificationEventHandler.php.
|
protected |
Get the entity from the notification event.
Definition at line 522 of file NotificationEventHandler.php.
|
final |
Returns methods to be used for this notification.
Definition at line 204 of file NotificationEventHandler.php.
|
finalprotected |
Get the delivery methods override.
Definition at line 67 of file NotificationEventHandler.php.
|
protected |
Get the attachments for this notification.
\ElggUser | $recipient | Notification recipient |
string | $method | Method |
Definition at line 500 of file NotificationEventHandler.php.
|
protected |
Get body for the notification.
Plugin can define a subtype specific body simply by providing a translation for the string "notification:<action>:<type>:<subtype>:body".
The arguments passed into the translation are:
Argument swapping can be used to change the order of the parameters. See http://php.net/manual/en/function.sprintf.php#example-5427
\ElggUser | $recipient | Notification recipient |
string | $method | Method |
Reimplemented in Elgg\Notifications\UnbanUserEventHandler, Elgg\Notifications\RemoveAdminUserEventHandler, Elgg\Notifications\MentionsEventHandler, Elgg\Notifications\MakeAdminUserEventHandler, Elgg\Notifications\Handlers\ValidateUser, Elgg\Notifications\Handlers\ResetUserPassword, Elgg\Notifications\Handlers\RequestUserPassword, Elgg\Notifications\Handlers\ConfirmPasswordChange, Elgg\Notifications\Handlers\ConfirmEmailChange, Elgg\Notifications\Handlers\ChangeUserPassword, Elgg\Notifications\Handlers\BanUser, Elgg\Notifications\Handlers\AdminValidation, Elgg\Notifications\Handlers\AddUser, and Elgg\Notifications\CreateCommentEventHandler.
Definition at line 439 of file NotificationEventHandler.php.
|
protected |
Get the notification methods to use.
Reimplemented in Elgg\Notifications\Handlers\ValidateUser, Elgg\Notifications\Handlers\ResetUserPassword, Elgg\Notifications\Handlers\RequestUserPassword, Elgg\Notifications\Handlers\ConfirmPasswordChange, Elgg\Notifications\Handlers\ConfirmEmailChange, Elgg\Notifications\Handlers\ChangeUserPassword, Elgg\Notifications\Handlers\BanUser, and Elgg\Notifications\Handlers\AddUser.
Definition at line 77 of file NotificationEventHandler.php.
|
protected |
Get subject for the notification.
Plugins can define a subtype specific subject simply by providing a translation for the string "notification:<action>:<type>:<subtype>:subject".
\ElggUser | $recipient | Notification recipient |
string | $method | Method |
Reimplemented in Elgg\Notifications\UnbanUserEventHandler, Elgg\Notifications\RemoveAdminUserEventHandler, Elgg\Notifications\MentionsEventHandler, Elgg\Notifications\MakeAdminUserEventHandler, Elgg\Notifications\Handlers\ValidateUser, Elgg\Notifications\Handlers\ResetUserPassword, Elgg\Notifications\Handlers\RequestUserPassword, Elgg\Notifications\Handlers\ConfirmPasswordChange, Elgg\Notifications\Handlers\ConfirmEmailChange, Elgg\Notifications\Handlers\ChangeUserPassword, Elgg\Notifications\Handlers\BanUser, Elgg\Notifications\Handlers\AdminValidation, Elgg\Notifications\Handlers\AddUser, and Elgg\Notifications\CreateCommentEventHandler.
Definition at line 400 of file NotificationEventHandler.php.
|
finalprotected |
Get an array of GUIDs to not get the subscription records for.
Definition at line 147 of file NotificationEventHandler.php.
|
protected |
Return the summary for a notification.
\ElggUser | $recipient | Notification recipient |
string | $method | Method |
Reimplemented in Elgg\Notifications\Handlers\AdminValidation, and Elgg\Notifications\CreateCommentEventHandler.
Definition at line 474 of file NotificationEventHandler.php.
|
protected |
Returns the url related to this notification.
\ElggUser | $recipient | Notification recipient |
string | $method | Method |
Reimplemented in Elgg\Notifications\RemoveAdminUserEventHandler, Elgg\Notifications\MakeAdminUserEventHandler, and Elgg\Notifications\Handlers\AdminValidation.
Definition at line 486 of file NotificationEventHandler.php.
|
finalprotected |
Get a parameter from the notification parameters.
string | $param | name of the parameter |
mixed | $default | default value is not found |
Definition at line 600 of file NotificationEventHandler.php.
Elgg\Notifications\NotificationEventHandler::getSubscriptions | ( | ) |
Returns subscriptions for the event.
Reimplemented in Elgg\Notifications\UnbanUserEventHandler, Elgg\Notifications\RemoveAdminUserEventHandler, Elgg\Notifications\MentionsEventHandler, Elgg\Notifications\MakeAdminUserEventHandler, Elgg\Notifications\InstantNotificationEventHandler, and Elgg\Notifications\Handlers\AdminValidation.
Definition at line 138 of file NotificationEventHandler.php.
|
static |
Is this event configurable by the user on the notification settings page.
Reimplemented in Elgg\Notifications\NonConfigurableNotificationEventHandler.
Definition at line 533 of file NotificationEventHandler.php.
|
staticfinal |
Can this event be configured for a specific entity.
For example this can be based on a group tools option which is enabled or not
\ElggEntity | $entity | the entity to check for |
Definition at line 547 of file NotificationEventHandler.php.
|
staticprotected |
Can this event be configured for a specific group.
For example this can be based on a group tools option which is enabled or not
\ElggGroup | $group | the group to check for |
Reimplemented in Elgg\Notifications\NonConfigurableNotificationEventHandler.
Definition at line 579 of file NotificationEventHandler.php.
|
staticprotected |
Can this event be configured for a specific user.
\ElggUser | $user | the user to check for |
Reimplemented in Elgg\Notifications\NonConfigurableNotificationEventHandler.
Definition at line 565 of file NotificationEventHandler.php.
|
finalprotected |
Prepares a notification for delivery.
array | $params | Parameters to initialize notification with |
RuntimeException |
Definition at line 362 of file NotificationEventHandler.php.
|
finalprotected |
|
final |
Process the event.
Definition at line 86 of file NotificationEventHandler.php.
|
finalprotected |
Send a notification to a subscriber.
\ElggEntity | $recipient | The recipient entity |
string | $method | The notification method |
array | $params | Default notification params |
Definition at line 275 of file NotificationEventHandler.php.
|
finalprotected |
Sends the notifications based on subscriptions.
Returns an array in the form: [ 25 => [ 'email' => true, 'sms' => false, ], 55 => [], ]
array | $subscriptions | Subscriptions for this event |
array | $params | Default notification parameters |
Definition at line 227 of file NotificationEventHandler.php.
|
finalprotected |
Override the default user preferred delivery methods with the given methods.
string[] | $methods | delivery methods |
Definition at line 57 of file NotificationEventHandler.php.
|
protected |
Definition at line 26 of file NotificationEventHandler.php.
|
protected |
Definition at line 21 of file NotificationEventHandler.php.