Sends a site member an email with a link to set or reset their password.
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.
function sendSetPasswordEmail(
email: string,
options: SetPasswordEmailOptions,
): Promise<void>;
Login email of the member whose password will be set or reset.
Email display options.
import { Permissions, webMethod } from "wix-web-module";
import { authentication } from "wix-members-backend";
/* Sample options value:
* {
* hideIgnoreMessage: false
* }
*/
export const mySendSetPasswordEmailFunction = webMethod(
Permissions.Anyone,
(email, options) => {
return authentication
.sendSetPasswordEmail(email, options)
.then((status) => {
if (status === true) {
console.log("Email sent");
}
return status;
})
.catch((error) => {
console.error(error);
});
},
);
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.