Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
38 lines
2.7 KiB
Markdown
38 lines
2.7 KiB
Markdown
# Proposal
|
|
|
|
## Why
|
|
|
|
No email provider will be configured for go-live on 2027-01-15. Forgot-password and the admin's "Send password reset" still create emails that carry a temporary password, but nobody receives them. `service-email` saves every email to its database before it tries to send it. So an admin who can read those saved emails can pass the password on in person. This gives self-service forgot-password a workaround until a provider is configured.
|
|
|
|
The legacy backoffice had an Email Listing screen for this, and babyboo's admin portal has a read-only email log, which this change follows.
|
|
|
|
## What Changes
|
|
|
|
- **Emails listing** (`/emails`), under a new `BO_EMAILS` module:
|
|
- Shows saved emails, newest first: date, recipients, subject and status.
|
|
- Filters by recipient, subject and date range, and is paged.
|
|
- The list never carries an email body.
|
|
- **Email detail** (`/emails/[id]`): shows one email with its body.
|
|
- The body is shown in a sandboxed frame with no scripts.
|
|
- Opening it writes an audit log line with the email id and the viewer. The line never contains the body.
|
|
- **Super admin emails are protected.** An admin who is not a super admin cannot open an email addressed to a super admin (403). The list still shows that the email exists. This stops a regular admin from triggering forgot-password for a super admin and reading the password.
|
|
- **Access:** the module is seeded with no role grants, so only super admins see it at first. They grant it to other roles under Roles.
|
|
- **Not in this change:** resend, email templates, SMS, and configuring an email provider.
|
|
|
|
## Capabilities
|
|
|
|
### New Capabilities
|
|
- `admin-emails`: the read-only email listing and detail, the super-admin protection, the audit line, and the module gate.
|
|
|
|
### Modified Capabilities
|
|
None.
|
|
|
|
## Impact
|
|
|
|
- **`solvway-mobile-api`:** `GET /api/admin/emails` and `GET /api/admin/emails/{id}` under `BO_EMAILS`. They read service-email's existing `/email/findByPropertyAndPageable` and `/email/findById/{id}`, and look up recipients with services-system `/user/findByEmail/{email}`.
|
|
- **`solvway-admin-portal`:** the `/emails` list and `/emails/[id]` detail pages, proxy routes, a service and i18n keys.
|
|
- **Database:** one new `module` row, `BO_EMAILS`, in `service-system`. It is added to the local seed (`local/seed/03-colite.sql`), and `sql/01-email-module.sql` in this change gives it to the DBA.
|
|
- **Docs:** `docs/deployment.md` lists the new SQL file, and section 10 explains the workaround.
|
|
- **Exposure:** Emails shows every email `service-email` has saved, not only password emails. That includes member email-verification codes and public contact or distributor form submissions with personal data. The module is therefore ungranted by default.
|
|
- No new dependency, and no change to service-email.
|