feat: add release communications
All checks were successful
deploy-socialize / image (push) Successful in 1m12s
deploy-socialize / deploy (push) Successful in 19s

This commit is contained in:
2026-05-07 21:00:59 -04:00
parent 7a8a0a44bf
commit b6eb348605
61 changed files with 8594 additions and 4 deletions

View File

@@ -0,0 +1,70 @@
# Task: Release update email digest
## Goal
Add optional daily email digests for inactive users with unread release updates, plus a developer-operated manual email push for important published updates.
## Feature Spec
- `docs/FEATURES/release-communications.md`
## Scope
- Add configuration to enable or disable release update email digests.
- Add persistence needed to rate-limit digest sends per user.
- Send at most one digest per user per day.
- Send only when the user has unread visible published release updates.
- Send only when the user has not logged in or opened the app in at least 24 hours.
- Initially target organization owners.
- Use the existing email infrastructure.
- Add a developer-only API endpoint to send an email announcement for a selected published release update.
- Add a developer-only back-office button for sending the selected update by email.
- Require confirmation before sending a manual push email.
- Support a "send to me only" test mode.
- Record manual push email metadata:
- sent by user id
- sent timestamp
- selected audience
- recipient count
- Prevent accidental duplicate push sends unless the developer explicitly confirms a resend.
- Keep user or organization email preferences out of this task.
## Likely Files
- `backend/src/Socialize.Api/Infrastructure/Emailer/**`
- `backend/src/Socialize.Api/Modules/ReleaseCommunications/**`
- `backend/src/Socialize.Api/Modules/Identity/**`
- `backend/src/Socialize.Api/Modules/Organizations/**`
- `frontend/src/features/release-communications/**`
- `frontend/src/locales/en.json`
- `frontend/src/locales/fr.json`
- `backend/tests/Socialize.Tests/**`
## Notes
- This task may require tracking a user's last app activity timestamp if login timestamp alone is not enough.
- Keep email copy concise and product-specific.
- The digest should link back to the app's Whats New page.
- Manual push emails should link directly to the selected update when possible.
- Do not introduce a new email provider.
## Validation
```bash
dotnet build backend/Socialize.slnx
dotnet test backend/Socialize.slnx
```
## Done When
- [x] Digest delivery is disabled unless explicitly configured.
- [x] Eligible organization owners receive at most one digest per day.
- [x] Digests are sent only when unread visible release updates exist.
- [x] Active users are not emailed.
- [x] Developers can manually send a published update email from the back office.
- [x] Developers can send a manual update email to themselves as a test.
- [x] Manual push sends require confirmation.
- [x] Manual push sends record sender, timestamp, audience, and recipient count.
- [x] Duplicate manual sends require explicit resend confirmation.
- [x] Email delivery uses existing email infrastructure.
- [x] Backend tests cover eligibility and rate limiting.