You are here

function hook_activity_recipient_organizer_alter in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  2. 8.4 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  3. 8.5 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  4. 8.7 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  5. 8.8 modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  6. 10.3.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  7. 10.0.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  8. 10.1.x modules/custom/activity_basics/activity_basics.api.php \hook_activity_recipient_organizer_alter()
  9. 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().
1 invocation of hook_activity_recipient_organizer_alter()
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 25
Hooks provided by the Activity module.

Code

function hook_activity_recipient_organizer_alter(array &$recipients, \Drupal\node\Entity\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(),
  ];
}