function NotificationHandler::sendRegisterPendingApprovalAdmin

Same name and namespace in other branches
  1. 11.x core/modules/user/src/NotificationHandler.php \Drupal\user\NotificationHandler::sendRegisterPendingApprovalAdmin()

Sends a notification email to the admin about an account pending approval.

Parameters

\Drupal\user\UserInterface $account: The entity that represents the user who is pending approval.

File

core/modules/user/src/NotificationHandler.php, line 84

Class

NotificationHandler
Implements a service to dispatch user notification messages.

Namespace

Drupal\user

Code

protected function sendRegisterPendingApprovalAdmin(UserInterface $account) : void {
  if ($this->configFactory
    ->get('user.settings')
    ->get('notify.register_pending_approval')) {
    $params['account'] = $account;
    $adminAddress = $this->getAdminAddress();
    if ($adminAddress !== NULL) {
      ($this->mailManager)()
        ->mail('user', 'register_pending_approval_admin', $adminAddress, $this->languageManager
        ->getDefaultLanguage()
        ->getId(), $params);
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.