function hook_activity_recipient_organizer_alter in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 8.4 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 8.5 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 8.6 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 8.7 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 8.8 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 10.3.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 10.0.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
- 10.2.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
Provide a method to alter the recipients used as Organizers.
Parameters
array $recipients: The recipients receiving a notification.
\Drupal\node\Entity\Node $event: The Event that was joined.
array $data: The data concerning the activity needed for context.
1 function implements hook_activity_recipient_organizer_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- social_event_managers_activity_recipient_organizer_alter in modules/
social_features/ social_event/ modules/ social_event_managers/ social_event_managers.module - Implements hook_activity_recipient_organizer_alter().
2 invocations of hook_activity_recipient_organizer_alter()
- EventRequestActivityContext::getRecipientOrganizerFromEntity in modules/
custom/ activity_basics/ src/ Plugin/ ActivityContext/ EventRequestActivityContext.php - Returns Organizer recipient from Events.
- OrganizerActivityContext::getRecipientOrganizerFromEntity in modules/
custom/ activity_basics/ src/ Plugin/ ActivityContext/ OrganizerActivityContext.php - Returns Organizer recipient from Events.
File
- modules/
custom/ activity_basics/ activity_basics.api.php, line 27 - Hooks provided by the Activity module.
Code
function hook_activity_recipient_organizer_alter(array &$recipients, Node $event, array $data) {
$organizers = $event
->getOwnerId();
if ($data['target_type'] !== 'event_enrollment') {
return;
}
// Add the creator of the Event as a recipient.
$recipients[] = [
'target_type' => 'user',
'target_id' => $organizers
->getOwnerId(),
];
}