function NotificationHandler::sendRegisterPendingApproval

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

Notifies the user that their registration request is pending approval.

Additionally notify an administrator about the newly registered account.

Parameters

\Drupal\user\UserInterface $account: The entity that represents the user who is being notified.

Return value

bool TRUE if the email has been sent successfully, FALSE if an error occurred or if the sending has been canceled.

File

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

Class

NotificationHandler
Implements a service to dispatch user notification messages.

Namespace

Drupal\user

Code

public function sendRegisterPendingApproval(UserInterface $account) : bool {
  $result = $this->sendToUser('register_pending_approval', $account);
  $this->sendRegisterPendingApprovalAdmin($account);
  return (bool) $result;
}

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