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 { authentication } from 'wix-members-backend';
2
3/* Sample options value:
4* {
5* hideIgnoreMessage: false
6* }
7*/
8
9export function mySendSetPasswordEmailFunction(email, options) {
10 return authentication.sendSetPasswordEmail(email, options)
11 .then((status) => {
12 if (status === true) {
13 console.log('Email sent');
14 }
15
16 return status;
17 })
18 .catch((error) => {
19 console.error(error);
20 })
21}