1 Commits
Author SHA1 Message Date
Lauri Ojansivu 9d1b2915ef Send a push notification (not just email) when a user is invited to a board.
#3136: Users.inviteUserToBoard (server/models/users.js) only ever sent an
invitation email. Board membership/watcher changes already fan out through
Notifications.notify(user, title, description, params) - the same helper
server/models/activities.js calls for card assignment, due dates, mentions
and every other activity-driven notification, reaching both the email
service and the in-app notification bell - but an invite itself never went
through it.

inviteUserToBoard now also calls Notifications.notify(user, 'push-invite-title',
'push-invite-text', params) with the same params object built for the
invitation email, right after the email is sent. It is guarded by
`!isNewUser`: a brand-new invitee created from an email address with no
matching WeKan account has no established notification target yet, so they
stay email-only, exactly as before, with no error. The push call has its own
try/catch so a failing notification service can never break the invite.

Added push-invite-title/push-invite-text to en.i18n.json and every other
locale file, reusing each locale's own already-translated
email-invite-subject/email-invite-text wording (the only existing invite
wording to draw a style from), so every locale ships a real translation
immediately - no English placeholders except the en-* regional variants,
which are English by design.

Added tests/boardInvitePushNotification.test.cjs: a source-inspection
regression test (inviteUserToBoard is a full Meteor method and cannot run
outside a Meteor server) pinning that the fix reuses the exact
Notifications.notify(user, title, description, params) helper/signature
already used elsewhere - exactly one call site, not a second
implementation - guarded by `if (!isNewUser)`, wrapped in its own try/catch,
with the email send left unconditional, and that every locale file carries
the two new keys with the same placeholder tokens as their email
counterparts.

Thanks to CondensedTea and xet7 !

Closes #3136,
2026-09-10 20:32:27 +03:00