From f7e9ad31fa7881ad8b0b0b6781a1d966ea616def Mon Sep 17 00:00:00 2001 From: habibullahm Date: Wed, 5 Aug 2026 18:28:21 +0700 Subject: [PATCH] refine: clarify password reset email wording Make the subject and body clearer, with a safer ignore note and a direct CTA to choose a new password. --- task-api/src/utils/mailer.util.ts | 19 ++++++++++--------- task-api/tests/auth-tasks.integration.test.ts | 3 ++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/task-api/src/utils/mailer.util.ts b/task-api/src/utils/mailer.util.ts index 55258ac..4b7581f 100644 --- a/task-api/src/utils/mailer.util.ts +++ b/task-api/src/utils/mailer.util.ts @@ -50,12 +50,13 @@ export class MailerUtil { private static buildBodies(resetUrl: string): { text: string; html: string } { const text = [ - 'Reset your Task Management password', + 'Reset your password', '', - 'We received a request to reset your password. Open this link (expires in 1 hour):', + 'Someone requested a password reset for your Task Management account.', + 'Use this link within the next hour to choose a new password:', resetUrl, '', - 'If you did not request this, you can ignore this email.', + 'If you did not make this request, you can safely ignore this email. Your password will stay the same.', ].join('\n'); const html = ` @@ -63,15 +64,15 @@ export class MailerUtil {

Reset your password

-

We received a request to reset your Task Management password. This link expires in 1 hour.

+

Someone requested a password reset for your Task Management account. Click the button below to choose a new password. This link expires in 1 hour.

- Reset password + Choose a new password

-

Or copy this link:

+

Or paste this link into your browser:

${resetUrl}

-

If you did not request this, you can ignore this email.

+

If you did not make this request, you can safely ignore this email. Your password will stay the same.

`.trim(); @@ -103,7 +104,7 @@ export class MailerUtil { .sendMail({ from, to, - subject: 'Reset your Task Management password', + subject: 'Reset your password — Task Management', text, html, }) @@ -145,7 +146,7 @@ export class MailerUtil { body: JSON.stringify({ from, to: [to], - subject: 'Reset your Task Management password', + subject: 'Reset your password — Task Management', text, html, }), diff --git a/task-api/tests/auth-tasks.integration.test.ts b/task-api/tests/auth-tasks.integration.test.ts index b7cb94d..cbf8a20 100644 --- a/task-api/tests/auth-tasks.integration.test.ts +++ b/task-api/tests/auth-tasks.integration.test.ts @@ -233,9 +233,10 @@ describe('API + DB integration', () => { const body = JSON.parse(String(init.body)); expect(body.to).toEqual([email]); expect(body.subject).toMatch(/reset/i); - expect(body.html).toMatch(/Reset password/); + expect(body.html).toMatch(/Choose a new password/); expect(body.text).toMatch(/reset-password\?token=/); expect(body.html).toMatch(/http:\/\/localhost:3000\/reset-password\?token=/); + expect(body.html).toMatch(/safely ignore/i); } finally { global.fetch = originalFetch; clearMailerEnv();