Search...
sendSetPasswordEmail( )
Sends a site member an email with a link to set their password.
Description
The sendSetPasswordEmail()
function returns a Promise that resolves
when the set password link is emailed to the member.
The set password link is valid for 3 hours, and it can be used only once. If the link expires, no changes are made to the password.
Syntax
function sendSetPasswordEmail(email: string, [options: SetPasswordEmailOptions]): Promise<void>
sendSetPasswordEmail Parameters
NAME
TYPE
DESCRIPTION
email
string
Login email of the member whose password will be set.
options
Optional
SetPasswordEmailOptions
Email display options.
Returns
Fulfilled - If the email is sent. Rejected - Error message.
Return Type:
Promise<void>
Was this helpful?
Email a member with a link to set their password
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { authentication } from 'wix-members-backend';34/* Sample options value:5* {6* hideIgnoreMessage: false7* }8*/910export const mySendSetPasswordEmailFunction = webMethod(Permissions.Anyone, (email, options) => {11 return authentication.sendSetPasswordEmail(email, options)12 .then((status) => {13 if (status === true) {14 console.log('Email sent');15 }1617 return status;18 })19 .catch((error) => {20 console.error(error);21 })22});