Commit 45f78be8 authored by catch's avatar catch
Browse files

Issue #3002019 by hanoii, dcam, rpayanm, giuseppe87: Register a user without...

Issue #3002019 by hanoii, dcam, rpayanm, giuseppe87: Register a user without email verification should still send an email

(cherry picked from commit a1bc1b39)
parent 2f94a274
Loading
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -179,11 +179,9 @@ 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);
    }
    }
    // Administrator approval required.
    elseif ($approval_settings == UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) {
      _user_mail_notify('register_pending_approval', $account);
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public function testRegisterUser(): void {
    $this->assertNotEmpty($user->getPassword());
    $email_count = count($this->drupalGetMails());

    $this->assertEquals(0, $email_count);
    $this->assertEquals(1, $email_count);

    // Attempt to register without sending a password.
    $response = $this->registerRequest('PhilipK.Dick', FALSE);