Workflows
Password Reset
Help users reclaim access to their account via the ‘Password Reset’ or ‘Forgot Username’ functions
Intro
To help users re-establish access to their account securely, a password reset email should be succint and have a unique password reset URL that expires after a given time. This example uses the payload schema to fetch the unique expiring password reset link.
Explore the source code on GitHub
Preview
Code Example
import { workflow } from '@novu/framework';
import { renderPasswordResetEmail } from '../emails/password-reset';
import { zodControlSchema, zodPayloadSchema } from './schemas';
export const DropboxPasswordResetEmail = workflow(
"Dropbox Password Reset",
async ({ step, payload }) => {
await step.email(
"send-email",
async (controls) => {
return {
subject: controls.emailSubject,
body: renderPasswordResetEmail(controls, payload),
};
},
{
controlSchema: zodControlSchema
}
);
},
{
payloadSchema: zodPayloadSchema
}
);
Was this page helpful?