Add queued email notifications for collaboration events

This commit is contained in:
2026-07-22 08:51:42 -04:00
parent b6d2ded141
commit 09f51d1ef4
20 changed files with 1507 additions and 102 deletions

View File

@@ -7,12 +7,12 @@
### Week 7: Comments & Notifications
- [x] Comment system (backend complete, UI partial)
- [x] Comment system (backend + UI wired)
- [x] Comment creation endpoint (web)
- [x] Comment threading (parent/child) - schema supports it
- [x] Line/section anchoring (hash-based)
- [x] Comment resolution (mark as resolved)
- [ ] Comment display in the Go-served browser UI (JS exists but needs wiring)
- [x] Comment display in the Go-served browser UI (`c39c50b` dropdown menu + comment side panel, `comments.js` +330 lines)
- [x] Notification system (backend complete)
- [x] Notification queue in database
@@ -29,18 +29,18 @@
### Week 8: Email Integration & Conflict Resolution
- [ ] Postmark integration
- [x] Postmark integration
- [x] SMTP sender stub (NoOp + SMTP implementations)
- [ ] Postmark adapter
- [ ] Plain-text email templates
- [ ] Outgoing email queue with retry
- [x] Postmark adapter (`email/postmark.go`)
- [x] Plain-text email templates (`email/templates.go`)
- [x] Outgoing email queue with retry (`email/queue.go` + migration 000016)
- [ ] Webhook endpoint for inbound email
- [ ] Email notification types
- [ ] File changed notification
- [ ] New comment notification
- [ ] Mention notification (@username)
- [ ] Conflict alert notification
- [x] Email notification types
- [x] File changed notification
- [x] New comment notification
- [ ] Mention notification (@username) — template exists, mention detection not wired
- [ ] Conflict alert notification — template exists, not triggered from sync flow
- [ ] Digest summary email
- [ ] Email reply handling
@@ -62,7 +62,7 @@
- [x] Comments are linked to document version (hash)
- [x] Comment threading works (reply to reply) (schema supports it)
- [x] Users can watch files or folders for changes (API exists)
- [ ] Email notifications sent within 1 minute of event (NoOp sender currently)
- [x] Email notifications sent within 1 minute of event (Postmark adapter + queue with retry)
- [ ] Replying to notification email creates a comment
- [ ] Digest emails batch notifications by time window
- [x] Conflicts display side-by-side diff (M2 sync)
@@ -70,11 +70,11 @@
- [ ] Resolved comments are hidden but accessible in history
### Non-Functional
- [ ] Emails are plain-text only (no HTML)
- [x] Emails are plain-text only (no HTML) — enforced by templates, verified by test
- [ ] Email threading works in Gmail, Outlook, Apple Mail
- [ ] Webhook signature verified for inbound email
- [ ] Failed emails retried 3 times with exponential backoff
- [ ] Email queue doesn't block web requests (async processing)
- [x] Failed emails retried 3 times with exponential backoff — queue.go, verified by test
- [x] Email queue doesn't block web requests (async processing) — worker runs in goroutine
### Email Template Examples