mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
merge: update Tours branch to current dev
This commit is contained in:
@@ -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(
|
||||
}
|
||||
<!-- Footer -->
|
||||
<tr><td style="padding: 20px 32px; background: #f9fafb; border-top: 1px solid #f3f4f6; text-align: center;">
|
||||
<p style="margin: 0 0 8px; font-size: 11px; color: #9ca3af; line-height: 1.5;">${s.footer}<br>${s.manage}</p>
|
||||
<p style="margin: 0 0 8px; font-size: 11px; color: #9ca3af; line-height: 1.5;">${s.footer}<br><a href="${manageHref}" style="color: #9ca3af; text-decoration: underline;">${s.manage}</a></p>
|
||||
<p style="margin: 0; font-size: 10px; color: #d1d5db;">${s.madeWith} <span style="color: #ef4444;">♥</span> by Maurice · <a href="https://github.com/liketrek/TREK" style="color: #9ca3af; text-decoration: none;">GitHub</a></p>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user