Mail¶
Two providers:
| Audience | Provider | Config |
|---|---|---|
| End users | Resend | RESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_FROM_NAME |
| Operator alerts | Mailtrap | MAILTRAP_API_TOKEN (code also accepts related names), MAILTRAP_FROM_*, ADMIN_EMAIL |
Implementation: src/mail/email_service.py, config in src/mail/config.py.
User emails (Resend)¶
- Magic link — enrollment / credential update link
- Credentials confirmation — after successful encrypt+store (may include deletion link)
- Sign-off result — after a Celery run (success, already signed, failure)
Sign-off emails can attach or link screenshots when bucket storage is configured.
Admin alerts (Mailtrap)¶
Examples that trigger send_admin_alert:
- Magic link create or send failure
- Credential encryption failure
- Users missing credentials during Sunday enqueue
- Credential create/update audit note
If Resend or Mailtrap packages are missing, those paths log warnings and skip sending.