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.