Repository navigation
Conversation
00b98d4 to
5b3ffbb
Compare
5b3ffbb to
b1e3e36
Compare
For the email content this is my suggestion. Subject: {{User_name}} replied to a comment in "{{document_title}}" Title: Button: {{Open}} Docs: Your essential tool for organizing, sharing, and collaborating on documents as a team. A solution by La Suite Numérique. |
Add the logic computing who must hear about a new comment in an existing thread and the email sent to them. The recipients are the participants of the thread (its creator, the authors of the earlier comments and the users mentioned in it) minus the author of the reply, deduplicated, and only active users holding an explicit access allowed to comment, like for mentions. Users the reply author just mentioned are skipped as the mention email already covers them. A per recipient guard avoids duplicates when a task is delivered twice and a failing recipient does not block the others. Signed-off-by: Anthony LC <anthony.le-courric@mail.numerique.gouv.fr>
Queue a Celery task when a comment is added to an existing thread, so the SMTP round-trips stay out of the request. Queuing is best effort and a failure to send never fails the creation of the comment. The first comment of a thread is created with the thread by another code path and is not notified. Signed-off-by: Anthony LC <anthony.le-courric@mail.numerique.gouv.fr>
Participants of a thread that keep answering each other got one email per reply. A user is now emailed at most once per THREAD_REPLY_NOTIFICATION_COOLDOWN_MINUTES (default 15, 0 disables it) in a thread. The delay is per user, so a participant not emailed yet is never silenced by the emails sent to the others, and it is fixed from the email, so a long conversation cannot keep a user uninformed. Signed-off-by: Anthony LC <anthony.le-courric@mail.numerique.gouv.fr>
b1e3e36 to
570b500
Compare
I added a commit frontend side to do it.
I updated the main email message. |
The reply email links to #thread=<id>,comment=<id> but nothing read that hash. Open the thread, scroll the editor to the commented text and the thread to the comment. Block anchors ignore this hash.
570b500 to
a0f816f
Compare
|
Size Change: +1 kB (+0.02%) Total Size: 4.06 MB 📦 View Changed
|
Purpose
Participants of a comment thread were never told about a reply unless they were mentioned. They now get an email when someone answers in a thread they take part in.
Proposal
THREAD_REPLY_NOTIFICATION_COOLDOWN_MINUTESin a thread (default 15, 0 disables). The delay is per user, so a participant who was not emailed yet is never silenced by the emails sent to the others: A creates a thread, B replies and A is emailed, A replies 5 minutes later and B is emailed (A is not, again). The delay is fixed from the email, the following replies do not extend it, so an active thread cannot keep a user uninformed. It is released when the email could not be sentNew env
docs/src/backend/impress/settings.py
Lines 531 to 536 in 00b98d4
Email Demo
Known limitations
MENTION_NOTIFICATION_COOLDOWN_MINUTES, is skipped because the mention email covers them. If that mention email was itself suppressed by the mention cooldown, the user gets neither email.Possible follow-up: a "seen" notion
Both limitations (and the repeated mention of a user in the same context within the mention cooldown) come from throttling on time only. We could throttle on whether the user has seen the thread instead:
(thread, user)withlast_seen_at; a user's own reply counts as seen).THREAD_REPLY_NOTIFICATION_COOLDOWN_MINUTES. When it runs, send the email only if the user has not seen the thread since the comment was created, and was not already emailed about an earlier unseen reply.POST threads/{id}/seen/called when the thread is displayed (accurate, but needs a small frontend change and has to work with the offline queue).