Hi I’ve followed a useful post here about custom form signup which I have linked to a data collection. So far this is how it looks code validation passes.
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function (){
$w(‘#button1’).onClick( function (){ let email = $w(‘#input3’).value;
wixUsers.register(email)
//This part is going to make membership pending approval
.then( (result) => { let status = result.status; // “Pending” let approvalToken = result.approvalToken; let user = result.user;
})
})
})
What I need to know is how can we do a template email with create password link rather than a password field on the form, any ideas how this is possible please.
I suggest you to use session wix -storage, so you can set the user’s email at temporary storage and then get it in another page. As a result, you will be able to set the password at different page and do the registration process from there.
Yes, you can create your own custom form signup and include all the relevant fields that you need include the password field.
Afterword, add an event handler that run when you are pressing on the submit button, and at the handler write the follow code:
import wixUsers from 'wix-users';
export function signUp_click(event) {
/*Here you create variables according to the fields you have in the form password and email are mandatory*/
let email = $w('#input6').value
let password = $w('#input10').value
let firstName = $w('#input4').value
let lastName = $w('#input5').value
let phone = $w('#input7').value
wixUsers.register(email, password, {
contactInfo: {
"firstName": firstName,
"lastName": lastName,
"phone": phone,
}
})
}
Afterword, the user will become a member site and appear at your member list.
Suggest you to view this article about wix CRM.