diff --git a/server/src/nest/notifications/mailer/email-html.ts b/server/src/nest/notifications/mailer/email-html.ts index 8bef780a7..6cf27d974 100644 --- a/server/src/nest/notifications/mailer/email-html.ts +++ b/server/src/nest/notifications/mailer/email-html.ts @@ -41,6 +41,7 @@ export function buildEmailHtml( const s = I18N[lang] || I18N.en; const appUrl = getAppUrl(); const ctaHref = escapeHtml(navigateTarget ? `${appUrl}${navigateTarget}` : appUrl || ''); + const manageHref = escapeHtml(`${appUrl}/settings?tab=notifications`); const safeSubject = escapeHtml(subject); const safeBody = rawBody ? body : escapeHtml(body); @@ -73,7 +74,7 @@ export function buildEmailHtml( } -

${s.footer}
${s.manage}

+

${s.footer}
${s.manage}

${s.madeWith} ♥ by Maurice · GitHub

diff --git a/server/tests/unit/nest/notification-transports.test.ts b/server/tests/unit/nest/notification-transports.test.ts index d799a9c92..111c9ce0a 100644 --- a/server/tests/unit/nest/notification-transports.test.ts +++ b/server/tests/unit/nest/notification-transports.test.ts @@ -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( + /]*>Manage preferences in Settings<\/a>/, + ); + }); + it('uses German i18n strings for lang=de', () => { const html = buildEmailHtml('Subject', 'Body', 'de'); expect(html).toContain('TREK aktiviert');