List each email once when the recipient join returns it twice. The proposal, design and handover now say Emails exposes every saved email, including member verification codes and form submissions, not only password emails. The design names the single catch-all proxy, the later-SQL table sits after the 04 check, and the seed header says the release package is frozen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2.7 KiB
2.7 KiB
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 newBO_EMAILSmodule:- 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/emailsandGET /api/admin/emails/{id}underBO_EMAILS. They read service-email's existing/email/findByPropertyAndPageableand/email/findById/{id}, and look up recipients with services-system/user/findByEmail/{email}.solvway-admin-portal: the/emailslist and/emails/[id]detail pages, proxy routes, a service and i18n keys.- Database: one new
modulerow,BO_EMAILS, inservice-system. It is added to the local seed (local/seed/03-colite.sql), andsql/01-email-module.sqlin this change gives it to the DBA. - Docs:
docs/deployment.mdlists the new SQL file, and section 10 explains the workaround. - Exposure: Emails shows every email
service-emailhas 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.