mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 19:25:16 +00:00
18 lines
582 B
JavaScript
Executable File
18 lines
582 B
JavaScript
Executable File
const { UserService } = require("m3o/user");
|
|
|
|
// Send an email with a verification code to reset password.
|
|
// Call "ResetPassword" endpoint once user provides the code.
|
|
async function sendPasswordResetEmail() {
|
|
let userService = new UserService(process.env.MICRO_API_TOKEN);
|
|
let rsp = await userService.sendPasswordResetEmail({
|
|
email: "joe@example.com",
|
|
fromName: "Awesome Dot Com",
|
|
subject: "Password reset",
|
|
textContent:
|
|
"Hi there,\n click here to reset your password: myapp.com/reset/code?=$code",
|
|
});
|
|
console.log(rsp);
|
|
}
|
|
|
|
sendPasswordResetEmail();
|