Commit Graph
2 Commits
Author SHA1 Message Date
Lauri Ojansivu 2b99ffe288 Source-scanning tests skip every _build* directory, not only _build.
After the Mocha stage of a full test run had compiled _build-local-test/,
tests/publishFilesCursor.test.cjs read server-rspack.js there and failed
on nine lines of bundled code. 62 tests walked the tree skipping _build by
exact name, so each of them read rspack's second copy of every source
file whenever a test build was present. They now skip by the _build
prefix, as tests/noIdentityReplacement.test.cjs already did, and
tests/sourceWalkersSkipBuildOutput.test.cjs fails on any walker that
skips _build by exact name only.

Thanks to xet7 !
2026-11-06 20:20:10 +02:00
Lauri Ojansivu f6e98f1205 Add an Admin Panel "Email Templates" UI for the customizable invite/activity email templates.
The Settings schema fields (inviteEmailSubjectTemplate/BodyTemplate,
activityEmailSubjectTemplate/BodyTemplate), their publication, and the
server-side use in sendInvitationEmail() (server/models/settings.js) and
the buffered activity-notification email (server/notifications/email.js)
already existed, reusing models/lib/ruleVarsSubstitute.js's substituteVars()
- the same {token} substitution the #3304 rule "send email" action uses -
but had no Admin Panel UI to set them, so an admin could not actually reach
the feature. Adds the missing fields (Admin Panel / Email / Email Templates)
with their own Save, right below the SMTP settings.

Left blank (the default on every existing install), WeKan sends its exact
current hardcoded/i18n content for both email types, unchanged. Password-
reset and account-verification emails are deliberately excluded: they stay
hardcoded, since a misconfigured or malicious custom template on a
security-critical email (e.g. one that strips the reset link) would be a
real account-takeover risk.

tests/emailTemplatesCustomization.test.cjs adds regression coverage: an
unset template falls back to exactly the current hardcoded/i18n content,
a set template is substituted through the existing substituteVars() (with
a source-pattern negative test proving there is no second/duplicate
templating implementation), the new Admin Panel labels are translated in
every locale file, and a negative test confirms the password-reset/
verification email code paths (server/lib/resetPasswordEmail.js,
config/accounts.js) never reference any of the four new template fields.

Thanks to saurabharch and xet7 !

Closes #2022,
2026-09-10 21:11:34 +03:00