You are here

public function TeamInvitationSubscriber::onCreated in Apigee Edge 8

Same name in this branch
  1. 8 modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php \Drupal\apigee_edge_teams\EventSubscriber\TeamInvitationSubscriber::onCreated()
  2. 8 modules/apigee_edge_teams/tests/modules/apigee_edge_teams_invitation_test/src/EventSubscriber/TeamInvitationSubscriber.php \Drupal\apigee_edge_teams_invitation_test\EventSubscriber\TeamInvitationSubscriber::onCreated()

Callback for on created event.

Parameters

\Drupal\apigee_edge_teams\Event\TeamInvitationEventInterface $event: The event.

File

modules/apigee_edge_teams/src/EventSubscriber/TeamInvitationSubscriber.php, line 109

Class

TeamInvitationSubscriber
Event subscriber for team invitation.

Namespace

Drupal\apigee_edge_teams\EventSubscriber

Code

public function onCreated(TeamInvitationEventInterface $event) {
  $team_invitation = $event
    ->getTeamInvitation();
  if (!$team_invitation
    ->isPending()) {
    return;
  }
  if ($this->teamInvitationNotifier
    ->sendNotificationsFor($team_invitation)) {
    $this->logger
      ->notice('Successfully sent invitation email to %recipient.', [
      '%recipient' => $team_invitation
        ->getRecipient(),
    ]);
  }
}