- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
12 KiB
Notification delivery: content, grouping and schedule
What it is
Notification delivery decides what a WeKan notification looks like and when it arrives, the same way for e-mail, the notification tray (the bell) and outgoing webhooks: what one notification shows, whether several are combined into one message, and on which schedule they are sent, with optional quiet hours. An admin sets defaults, a board admin sets a board's, and a member sets their own.
Read more
- Email, Webhook, Notification system and Do not disturb (quiet hours) on Wikipedia.
- Issues #3695, #5171 and #4434.
- WeKan pages: Notification Settings, Webhook data, Global Webhooks, ntfy and browser notifications.
How to use it
- Open the Notifications popup from the level you want to set:
- Admin Panel → People → Notifications (instance defaults, instance admins);
- Board Settings → Notifications (this board, board admins);
- Member Settings → Notifications (your own e-mail and tray);
- a webhook's own form (Board Settings → Outgoing Webhooks, or Admin Panel → Settings → Global Webhooks).
- In the channel's section (Email, Notifications tray, Outgoing Webhooks) choose the Layout (One sentence (classic) or Clearly arranged: board, who, card in bold) and, under Show, the parts.
- Choose the grouping and the schedule, and optionally quiet hours.
- Choose "Default" to clear a level's value so it inherits.
- Save.
How the numbers are calculated
From models/lib/notificationDelivery.js and server/notifications/emailQueue.js:
- The immediate e-mail delay is
EMAIL_NOTIFICATION_TIMEOUTmilliseconds when it is a positive number, otherwise 30 000 ms (30 s). - The grouping window for webhooks is 30 000 ms when the schedule is
Immediately and grouping is on (
WEBHOOK_GROUP_WINDOW_MS). - Intervals are only 5, 10, 15, 30, 60, 120, 240, 480, 720 or 1440 minutes
(
INTERVAL_MINUTES). The next delivery is the next boundary of the local clock:minuteOfDay = hour * 60 + minute, next boundary =(floor(minuteOfDay / interval) + 1) * interval, carried over to the next day past 1440 (nextIntervalBoundary()). - Once a day is the next time the local clock shows the chosen
HH:MM(default08:00), today or within the next two days. - Quiet hours: a delivery time inside them moves to the next quiet-hours
end (
inQuietHours(),nextDailyTime()); a window with the same start and end is no window. - Time zone: the one saved with the setting, else
UTC.
How it works in WeKan
Issues: #3695 (what webhooks send), #5171 (clearly arranged, combined e-mails).
Every notification channel - e-mail, the notification tray (the bell) and outgoing webhooks - has the same three kinds of settings:
- Content - what one notification shows.
- Grouping - one message per notification, or several combined.
- Schedule - when it is delivered: immediately, every N minutes/hours, or once a day, with optional quiet hours.
One shared, pure module resolves and applies them for every channel:
models/lib/notificationDelivery.js. Each channel only adapts its output.
The built-in behaviour
With nothing set anywhere, every channel behaves as below. E-mail is in the clearly arranged layout since #4434; everything else is what WeKan always did:
| Channel | Built-in behaviour |
|---|---|
the clearly arranged layout, with a plain-text alternative; everything due for a recipient combined into one e-mail, sent EMAIL_NOTIFICATION_TIMEOUT (30 s) after the notification |
|
| Tray | the classic activity line; every notification its own entry, shown at once |
| Webhook | text plus the standard attributes (WEBHOOKS_ATTRIBUTES); one POST per notification, at once |
Where to set it, and which setting wins
The Notifications popup has a section per channel (Email, Notifications tray, Outgoing Webhooks), opened from:
- Admin Panel → People → Notifications: the instance defaults (instance admins);
- Board Settings → Notifications: this board's settings (board admins);
- Member Settings → Notifications: the member's own e-mail and tray;
- each webhook's own form (Board Settings → Outgoing Webhooks, Admin Panel → Settings → Global Webhooks): that webhook.
Each key (layout, parts, grouping, schedule, interval, time, quiet hours) is resolved on its own; the most specific level that sets it wins:
E-mail, tray: Member Settings -> Board -> Admin Panel -> built-in
Webhooks: the webhook -> Board -> Admin Panel -> built-in
- The board level applies to that board's notifications, and for webhooks only to the board's own webhooks: a global webhook belongs to the instance administrator, so a board admin cannot reshape it.
- A member cannot change a board's webhook delivery. What a member owns there is their identity: Leave my name out of outgoing webhooks (see Webhook data).
- "Default" (board, member, webhook) clears that level's value so it inherits.
All settings are saved through one server method,
setNotificationDelivery(scope, targetId, channel, settings)
(server/methods/notificationDelivery.js). It accepts only the known keys and
values, and only from the right role: instance admins for the Admin Panel and
global webhooks, the board's admins (or an instance admin) for a board and its
webhooks, and a member only for their own profile. The database schemas carry
the same allowed values, so a direct document write cannot store anything else.
Content
E-mail and tray: layout and parts
Layout: One sentence (classic) is the sentence WeKan always sent:
NAME created card "TEst" to list "To Do" at swimlane Social Network at board "Projekt Teilbereich C" LINK
Clearly arranged puts the board first and the board, the actor and the card in bold, with links (#5171), showing only the chosen parts:
[Projekt Teilbereich C](board link): NAME created card ["TEst"](card link) to list "To Do"
| Part | Shows |
|---|---|
board |
the board name, linked, at the start of the item |
actor |
who did it |
card |
the card title as a link to the card |
list |
the list (and the previous list of a move) |
swimlane |
the swimlane |
details |
the comment text or the changed value |
dates |
the dates of a date change |
link |
the link on a line of its own, as in the classic layout |
A part that is switched off removes its clause from the sentence ("at swimlane ...") in any language, as long as the clause is joined by a short connector; where removing it would break the sentence the value stays. E-mail in the clear layout also carries a plain-text alternative of every item.
An admin's own activity e-mail template (Admin Panel → Email Templates) still wins over the layout: it is the more specific instruction.
E-mail uses Clearly arranged unless a level chooses One sentence (classic) (#4434); the tray keeps the classic line. Account e-mails - reset password, verify e-mail, a new account and board invitations - are sent in the same clear HTML style, built from the same translated text, which is also sent as their plain-text part.
Webhooks
Send the message text and Send these fields - see Webhook data for every property.
What is never shown
- A notification only reaches a member of the board who may see it (the existing recipient rules, re-checked when a queued e-mail is sent).
- The value of an admin-only custom field (#3141) reaches only the board's admins - in e-mail and the tray, in both layouts - and never a webhook.
- Every user-written value (titles, names, comments) is HTML-escaped, and a
link is made only from an
http(s)URL.
Grouping
| Channel | Options |
|---|---|
| Everything due in one e-mail (built-in), one per board, one per card, each on its own | |
| Tray | Each on its own (built-in), one row per card, one row per board ("3 notifications on card X", expandable) |
| Webhook | Each on its own (built-in), everything in one POST, one per board, one per card |
A grouped webhook POST is
{ "text": "...", "description": "act-batch", "count": 3, "items": [ ... ] },
each item the body a single notification would have sent; a group of one is
sent as that single body. Grouping waits a short window (30 s) when the
schedule is Immediately, so notifications that arrive together go together.
Schedule
- Immediately - the built-in timing above.
- Every N minutes/hours (5, 10, 15, 30 minutes; 1, 2, 4, 8, 12, 24 hours) - delivered at the next boundary of the local clock (for one hour: on the hour), so everything inside one window is delivered, and grouped, together.
- Once a day at a chosen time.
- Quiet hours (from - to, may span midnight) - anything that would be delivered inside them waits until they end.
Times are in the time zone saved with the setting: the browser's time zone of whoever set it (shown under the setting), UTC if none.
Durable, exactly-once delivery
- E-mail uses the existing durable outbox (
server/lib/emailOutbox.js): each notification is a stored job with its delivery time before anything is sent; one e-mail carries the jobs of one group; a job is marked sent only after the mail server accepted it. A restart in a window loses nothing, and a stored job keeps its time when a setting changes later. - Tray: the entry is stored at once with a
showAttime; the drawer and the bell show it when the time comes. Nothing is waiting in memory. - Webhooks: a grouped or scheduled webhook notification is stored in the
webhook queue (
server/lib/webhookOutbox.js,server/notifications/webhookQueue.js) and POSTed to the webhook as it is at delivery (a deleted or disabled webhook cancels it; the current URL and token are used). It is marked sent after a 2xx answer and retried with backoff otherwise. Like e-mail, a crash between the HTTP answer and the acknowledgement can repeat that one request (at-least-once). - Two-way webhooks are always immediate: their reply edits the comment the
event was about. Webhooks planned by board Sync (
server/notifications/ prepareWebhooks.js, stored plans with their own delivery receipts) are delivered immediately too, with the content settings applied.
Related
Commits
- On Sandstorm, webhooks go through the Powerbox
- E-mails in the clear HTML layout by default
- Choose what notifications contain, and group and schedule them
- Share notification delivery slots across workers
- Bounded concurrency for independent e-mail recipients
- Bound e-mail retries and expose stopped delivery
- Administrator recovery controls for queued e-mail
- Persist notification e-mail jobs and resume after restart