Files
vitareba/app/api/documents
g-butandClaude Sonnet 4.6 08854eadcd feat(notifications): email patients when document uploaded or programme assigned
Two UX gaps where patients had no signal that something happened:
- Document upload: admin POSTs to /api/documents → patient now gets
  "New document shared: <title>" email linking to /documents
- Programme assignment: admin PATCHes programme → patient gets enrolment
  email with programme name, phase label, and phase description; fires
  only on first insert, not on subsequent updates

Both sends are fire-and-forget (.catch logged) so API response is never
blocked. Adds newDocumentEmail + programmeAssignedEmail templates with
escaping and 8 new tests (360 total, 0 failures).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 14:39:41 +02:00
..