fix(email): link notification preferences to settings tab

- Make the “Manage preferences” text in notification emails clickable.
- Link directly to `/settings?tab=notifications`.
- Preserve the localized link text and existing email styling.
- Add a regression test for the generated preferences URL.
This commit is contained in:
Luffy
2026-09-28 17:40:45 +08:00
committed by Maurice
parent c93cf2bce9
commit c7793a6017
2 changed files with 9 additions and 1 deletions
@@ -221,6 +221,13 @@ describe('buildEmailHtml', () => {
expect(html).toContain('notifications enabled in TREK');
});
it('links notification preferences to the notifications settings tab', () => {
const html = buildEmailHtml('Subject', 'Body', 'en');
expect(html).toMatch(
/<a href="https?:\/\/[^"]+\/settings\?tab=notifications"[^>]*>Manage preferences in Settings<\/a>/,
);
});
it('uses German i18n strings for lang=de', () => {
const html = buildEmailHtml('Subject', 'Body', 'de');
expect(html).toContain('TREK aktiviert');