Email Notifications
Last updated: 2026-07-06
Email System
HaMi Code Việt sends email notifications via the Resend API. The system uses a queue and retry mechanism to ensure emails reach users.
Email Delivery Flow
- Route creates an email send request
- Email is enqueued to the
email-deliveryqueue - Consumer picks up the email from the queue
- Sends via the Resend API
- If failed, retries up to 3 times
- If still failed, moves to DLQ (
email-dlq)
Email Types
| Type | When sent |
|---|---|
| welcome | After successful signup |
| verification | Email verification |
| password_reset | Password reset request |
| guardian_verification | Guardian verifies a link |
| contact | Contact form auto-reply |
Sender Address
All emails are sent from [email protected].
Email Health Check
GET /health/emailReturns the Resend configuration status (whether the API key is set).
Security
The system fails closed (returns 503) if RESEND_API_KEY is missing. Never logs tokens or PII.