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

  1. Route creates an email send request
  2. Email is enqueued to the email-delivery queue
  3. Consumer picks up the email from the queue
  4. Sends via the Resend API
  5. If failed, retries up to 3 times
  6. If still failed, moves to DLQ (email-dlq)

Email Types

TypeWhen sent
welcomeAfter successful signup
verificationEmail verification
password_resetPassword reset request
guardian_verificationGuardian verifies a link
contactContact form auto-reply

Sender Address

All emails are sent from [email protected].

Email Health Check

GET /health/email

Returns 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.