Description
The Email Users modal offers a READONLY_ADMIN option in the recipient-group dropdown, but the backend does not accept that group. Selecting it always fails with a 400, and the admin sees only a generic "try again" snackbar with no indication that the option can never work.
src/components/EmailModal/EmailModal.tsx:185-188 lists READONLY_ADMIN among the dropdown options. The backend's massEmailGroups map in internal/model/massemails.go:17-24 contains only ISSO, ISSM, SYSTEM_DELEGATE, DCC, ALL, and ADMIN. A group outside that map fails isValid() and returns 400.
Steps to Reproduce
- Sign in as an OWNER or HHS_ADMIN
- Open the "..." menu in the header and choose "Email Users"
- In "Select the group to email", choose
READONLY_ADMIN
- Fill in a subject and body, then click Send
- See the generic error snackbar; no email is sent
Expected Behavior
Either the group is a valid audience and the send succeeds, or it is not offered in the dropdown at all. A user should never be presented with a choice that cannot succeed.
Actual Behavior
The API returns 400. The frontend catches it and shows only ERROR_MESSAGES.tryAgain, so the admin has no way to tell that the failure is permanent rather than transient — retrying will fail identically every time.
Environment
Any browser; reproducible in all environments. Frontend EmailModal.tsx against the /api/v1/massemails endpoint.
Acceptance Criteria
Severity
Medium - Affects functionality but has workaround
Affected Component
Email Users modal (src/components/EmailModal/EmailModal.tsx)
Workaround
Choose ADMIN instead, which reaches the OWNER, HHS_ADMIN, and OPDIV_ADMIN tiers. There is no way to email read-only admins, by design.
Additional Context
Part of epic CMS-Enterprise/ztmf#503, but independent of that epic's sequencing — this can ship at any time, including immediately.
The fix is to remove the dropdown option, not to add the group to the backend. The backend exclusion is deliberate and documented in a comment at internal/model/massemails.go:151-156: read-only admin tiers are intentionally excluded for parity with pre-multi-OpDiv behavior, which emailed only ADMIN and never READONLY_ADMIN. The ADMIN key there is an audience selector in the API contract, not a user role.
Labeled needs-refinement.
Description
The Email Users modal offers a
READONLY_ADMINoption in the recipient-group dropdown, but the backend does not accept that group. Selecting it always fails with a 400, and the admin sees only a generic "try again" snackbar with no indication that the option can never work.src/components/EmailModal/EmailModal.tsx:185-188listsREADONLY_ADMINamong the dropdown options. The backend'smassEmailGroupsmap ininternal/model/massemails.go:17-24contains onlyISSO,ISSM,SYSTEM_DELEGATE,DCC,ALL, andADMIN. A group outside that map failsisValid()and returns 400.Steps to Reproduce
READONLY_ADMINExpected Behavior
Either the group is a valid audience and the send succeeds, or it is not offered in the dropdown at all. A user should never be presented with a choice that cannot succeed.
Actual Behavior
The API returns 400. The frontend catches it and shows only
ERROR_MESSAGES.tryAgain, so the admin has no way to tell that the failure is permanent rather than transient — retrying will fail identically every time.Environment
Any browser; reproducible in all environments. Frontend
EmailModal.tsxagainst the/api/v1/massemailsendpoint.Acceptance Criteria
READONLY_ADMINis no longer offered in the group dropdownmassEmailGroupsand sends successfullyEmailModal.test.tsxsuiteSeverity
Medium - Affects functionality but has workaround
Affected Component
Email Users modal (
src/components/EmailModal/EmailModal.tsx)Workaround
Choose
ADMINinstead, which reaches the OWNER, HHS_ADMIN, and OPDIV_ADMIN tiers. There is no way to email read-only admins, by design.Additional Context
Part of epic CMS-Enterprise/ztmf#503, but independent of that epic's sequencing — this can ship at any time, including immediately.
The fix is to remove the dropdown option, not to add the group to the backend. The backend exclusion is deliberate and documented in a comment at
internal/model/massemails.go:151-156: read-only admin tiers are intentionally excluded for parity with pre-multi-OpDiv behavior, which emailed onlyADMINand neverREADONLY_ADMIN. TheADMINkey there is an audience selector in the API contract, not a user role.Labeled
needs-refinement.