1

I would like to prevent the 'Activate Your Account' w/link from being sent when users first registers via a front-end public registration.

I need activation to happen manually via an Admin.

I have temporarily blocked this by commenting it out in /craft/app/controllers/UsersController.php Obviously I do not want to go to production with this, so how can I disable via a plugin?

The code in question appears on line 1049:

//
        if ($verifyNewEmail)
        {
            // Temporarily set the unverified email on the UserModel so the verification email goes to the
            // right place
            $originalEmail = $user->email;
            $user->email = $user->unverifiedEmail;

            if ($isNewUser)
            {
                // Send the activation email
                // $emailSent = craft()->users->sendActivationEmail($user);
                $emailSent = true; // *** NOT TRUE, BUT HACKED ***
            }
            else
            {
                // Send the standard verification email
                $emailSent = craft()->users->sendNewEmailVerifyEmail($user);
            }

            if (!$emailSent)
            {
                craft()->userSession->setError(Craft::t('User saved, but couldn’t send verification email. Check your email settings.'));
            }

            // Put the original email back into place
            $user->email = $originalEmail;
        }
4
  • Seems like you just want to uncheck "Verify Email Addresses?" under Settings->Users->Settings? – Brad Bell Jan 19 '18 at 0:43
  • For future reference: if there is no setting for such tasks the best way to solve this would be to create a custom plugin with a controller that extends the UserController where you overwrite the things you want to change – Robin Schambach Jan 19 '18 at 7:33
  • @BradBell thanks that worked. I must have had something else in-flux during my original attempts with that Admin setting – Jeremy A Jan 19 '18 at 21:55
  • @JeremyA Awesome... if you want to add it as an official answer, I'll throw some points/reputation your way. :) – Brad Bell Jan 19 '18 at 21:56
1

Thanks to @BradBell - I just needed to use the Admin setting.

Seems like you just want to uncheck "Verify Email Addresses?" under >Settings->Users->Settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.