Send handover mail to the people affected by a permanent takeover
A permanent case handover needs two different messages. When the advice seeker must consent, the email asks them to sign in and opens that exact request. Once the takeover commits, the incoming counsellor receives the confirmation and a link to the consultation. Temporary co-access does not send either handover email.
This change follows the agreed Admin Settings SMTP route for platform mail and the tenant's OWN route when configured. It keeps the email subject neutral for the advice seeker and uses the configured tenant name and URL. If a required route, URL, or brand is missing, delivery fails with a safe configuration message.
What we need to do
Review this after the shared notification sender work in UserService #1297. The branch contains that source as a dependency, including the locale and branding work from #1291, #1315, and #1316. The template source is Frontend #1568 plus companion handover copy #1592. TenantService #280 defines the OWN relay purpose names used here. Please review the #869-specific commits separately before merging.
How to test it quickly
- On Dev, request a TAKEOVER that needs client consent. The advice seeker should receive a neutral email whose action opens the exact pending request.
- Approve that request. The incoming counsellor should receive one confirmation whose action opens the consultation.
- Grant temporary CO_ACCESS. Neither takeover email should arrive.
- Repeat with PLATFORM and OWN SMTP routing, then compare received subject, recipient, links, and configured brand.
- Check each of the seven locale variants. Dev's explicit pending-translation opt-in is tracked in Helm feat: tenant-scoped admin dashboard statistics endpoint #390; human copy review remains outstanding.
What else I found
Delivery is scheduled after the database transaction commits. This avoids mail for rolled-back handovers, but an in-process after-commit callback is not a durable queue: a process crash in that short window can lose a notification. No exactly-once delivery guarantee is claimed. Source tests and packaging passed locally; CI, merge, deployment, and Dev inbox receipt remain separate checks.
For developers — source, contracts, and local verification:
Refs: OpenResilienceInitiative/ORISO-Frontend#869; OpenResilienceInitiative/ORISO-UserService#200
Target: dev
Source head before publication: 4227dd529
Dependencies: UserService #1297 (#1291, #1315, #1316), Frontend #1568 + handover copy companion, TenantService #280, Helm #390 Dev locale opt-in
Owned delivery outcomes: HANDOVER_REQUESTED, HANDOVER_CONFIRMED
Existing session-scoped consent lookup uses PESSIMISTIC_WRITE; no new lock or replay claim.
Local: 192 focused Java tests across 8 suites pass on integrated baseline; final CTA-specific tests pass; Spotless check and Maven package -DskipTests pass.
28 handover template resources byte-match Frontend generated plain snapshots.
No Dev mail receipt, merge, or deployment verified by this PR.