mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
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,