Turn off email confirmation when registering new user? (custom registration)

I’ve created a custom registration page that only site admin’s are able to access. The purpose of this is to only allow admins to register new site users.

Since site admins are going to be the ones adding new users to the site, I do NOT want the “click the link to confirm your email” message going out when we are registering new users (since they will already be confirmed).

Here is the code within the site admin page that I’m using to register new users:

export function buttonsubmitnewuser_click(event) {

            wixUsers.register($w('#inputemailaddress').value,                  $w('#inputpassword').value, {
                     "contactInfo": {
                     "firstName": $w('#inputfirstname').value,
                     "lastName": $w('#inputlastname').value
                            }
                      });

              $w("#textnewuseralert").text = "User has been registered!"
              $w("#textnewuseralert").show(); 
   });      

Calling the register function is triggering the confirmation email. How do I call this function without sending that email?

Thanks in advance for any assistance!!

I do NOT want the “click the link to confirm your email” message going out when we are registering new users (since they will already be confirmed).

Are you using Wix Users Backend API and verifying the user by email as that is when you need to click the link to confirm your email.
https://www.wix.com/corvid/reference/wix-users-backend.html

Register a user sending an email for confirmation

This example demonstrates a common email verification flow. A user is initially registered but not yet approved. At registration, a verification email is sent with a link to a verification page. When a user goes to the verification page, the approval is granted and the user is logged into the site.
The code is split between three locations:

  • A backend web module named register.jsw .

  • The page code for the page where users register.

  • The page code for the page where users confirm their registration.

/*******************************
 * backend code - register.jsw *
 *******************************/
import wixUsersBackend from 'wix-users-backend';

export function doRegistration(email, password, firstName, lastName) {
  // register the user
  return wixUsersBackend.register(email, password, {
    "contactInfo": {
      "firstName": firstName,
      "lastName": lastName
    }
  } )
  .then( (results) => {
    // user is now registered and pending approval
    // send a registration verification email
    wixUsersBackend.emailUser('verifyRegistration', results.user.id, {
      "variables": {
        "name": firstName,
        "verifyLink": `http://yourdomain.com/post-register?token=${results.approvalToken}`
      }
    } );
  } );
}

export function doApproval(token) {
  // approve the user
  return wixUsersBackend.approveByToken(token)
  // user is now active, but not logged in
  // return the session token to log in the user client-side
    .then( (sessionToken) => {
      return {sessionToken, "approved": true};
    } )
    .catch( (error) => {
      return {"approved": false, "reason": error};
    } );
}

/*********************************
 * client-side registration code *
 *********************************/
import wixUsersBackend from 'wix-users';
import {doRegistration} from 'backend/register';

export function button_click(event) {
  let email = // the user's email address
  let password = // the user's password
  let firstName = // the user's first name
  let lastName = // the user's last name

  doRegistration(email, password, firstName, lastName)
    .then( () => {
      console.log("Confirmation email sent.");
    } );
}

/**************************************
 * client-side post-registration code *
 **************************************/
import wixLocation from 'wix-location';
import wixUsersBackend from 'wix-users';
import {doApproval} from 'backend/register';

$w.onReady( () => {
  // get the token from the URL
  let token = wixLocation.query.token;

  doApproval(token)
    .then( (result) => {
      if (result.approved){
        // log the user in
        wixUsersBackend.applySessionToken(result.sessionToken);
          console.log("Approved");
      }
      else {
        console.log("Not approved!");
      }
    } );
} );

If you just use the Wix Users API and the register function in that, then you have the choice of either automatically approving the user or having them set as pending and then you have to confirm them through Contacts in your Dashboard, or by using the Wix Users Backend API options of approveByEmail or approveByToken.

https://www.wix.com/corvid/reference/wix-users.html#register

If Site Members is configured for automatic approval, the register() function returns a status of “Active” and the user becomes an active member of the site.

If Site Members is configured for manual approval, the register() function returns a status of “Pending” and the user becomes a pending member of the site. In order to activate a pending user, the site owner can approve the user manually, using the Contacts application or you can call the approveByToken() or approveByEmail() functions.

You can’t turn off the email that gets sent when you do pending approval.

Who can be a member?
Choose who can be a member of your site:

  • Everyone: When a new member signs up, they are approved automatically. You do not need to do anything.

  • People I approve: When a new member signs up, you receive a notification, both by email and in your site’s dashboard, asking if you want to approve or reject them. Only those who you approve become site members.

Finally note that I asked this to Wix Support myself in Jan 2019 as I wanted to get an automated email from being sent out as well and even they agreed that it was daft that you had automated emails going out even if you had setup your own automation or triggered email.

So, unless you can edit or turn off the notifications like you can now in some Wix apps, then you just have to live with the automated email.

Like here.

Thank you for the response!

I apologize if I’m misunderstanding, but if I turn on “automatic approval”, then the confirmation email will not be sent out?

I would have to do this in a separate member signup lightbox, and not on a standard page, correct?

Thanks again!

this is something I am currently looking into myself. Just like OP, I only want admins to register users on a custom dashboard sign up with no email confirmation going out to members. Is the approveByToken() method the best way to go?

@scardeccofficial Did you manage to get this to work? I’ve encountered the same problem. My users will actually need to click confirm in a confirmation email that is sent by Wix on behalf of us to be able to log into the page.

This problem of an automatic email being issued when a site member is approved is incredibly stupid but worse still is the contents of the mail that is issued can not be changed. I’m using lightbox on my website for the members form and I despair on how amateurish it is in the programming. What i want, and in this day and age it should be expected is that a site user fills in the form to become a member, using automatons I can send automatically an email with my text in it thanking them, I then want to be able to view the application and approve if the criteria is acceptable, when approving an automatic email is issued that I have no control over and no possibility to change the text, this I think is worse than moronic. I was promised by the blurb that this ascend tools to make a members area was fully controllable, the reality is disappointingly not like that and it seems that Ascend programmers are not up to the job to put right this stupid email issue with “Hi there…” text, even as bad you can not pre-approve a member.

I wish you hadn’t made that request from Wix, it’s such a stupid thing, they didn’t do it well

Is it possible to use the approveByToken function to bypass the email confirmation step and automatically log in the user to the site? (Assuming they are set as a member in the backend)