Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UserRegistrationResource.php

function UserRegistrationResource::sendEmailNotifications

Sends email notifications if necessary for user that was registered.

Parameters

\Drupal\user\UserInterface $account: The user account.

1 call to UserRegistrationResource::sendEmailNotifications()
UserRegistrationResource::post in core/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php
Responds to user registration POST request.

File

core/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php, line 178

Class

UserRegistrationResource
Represents user registration as a resource.

Namespace

Drupal\user\Plugin\rest\resource

Code

protected function sendEmailNotifications(UserInterface $account) {
    $approval_settings = $this->userSettings
        ->get('register');
    // No email verification is required. Activating the user.
    if ($approval_settings == UserInterface::REGISTER_VISITORS) {
        if ($this->userSettings
            ->get('verify_mail')) {
            // No administrator approval required.
            _user_mail_notify('register_no_approval_required', $account);
        }
    }
    elseif ($approval_settings == UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) {
        _user_mail_notify('register_pending_approval', $account);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal