diff --git a/src/services/emailService.server.ts b/src/services/emailService.server.ts index 1faafc5f..02508a2c 100644 --- a/src/services/emailService.server.ts +++ b/src/services/emailService.server.ts @@ -91,4 +91,35 @@ export const sendDealNotificationEmail = async (to: string, name: string | null, text, html, }); +}; + +/** + * Sends a password reset email to a user containing a link with their reset token. + * @param to The recipient's email address. + * @param token The unique password reset token. + */ +export const sendPasswordResetEmail = async (to: string, token: string) => { + const subject = 'Your Password Reset Request'; + // Construct the full reset URL using the frontend base URL from environment variables. + const resetUrl = `${process.env.FRONTEND_URL}/reset-password?token=${token}`; + + const html = ` +
You requested a password reset for your Flyer Crawler account.
+Please click the link below to set a new password. This link will expire in 1 hour.
+ Reset Your Password +If you did not request this, please ignore this email.
+