Set up, configure, and run the Reloop platform email microservice locally.
Platform transactional emails triggered by NATS events (invites, OTPs, billing alerts).
Overview
| Property | Value |
|---|---|
| Directory | apps/backend/email |
| Port | 8022 |
| Local URL | https://local.reloop.sh/api/email |
| Swagger UI | https://local.reloop.sh/api/email/openapi |
| Stack | ElysiaJS · Redis · NATS |
Quick start
bun be:email:dev
Or bun backend:dev / bun dev. Locally, when RELOOP_API_KEY is unset, mail falls back to Mailpit SMTP (localhost:1025).
Environment
apps/backend/email/.env — from bun setup / bun env:setup.
EMAIL_PORT=8022
PORT=8022
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
RELOOP_API_KEY=
RELOOP_SENDER_DOMAIN=
ONBOARDING_TEST_DOMAIN=
NODE_ENV=development
| Variable | Required | Default | Notes |
|---|---|---|---|
EMAIL_PORT / PORT | YES | 8022 | Listening port |
BASE_URL | YES | https://local.reloop.sh | Platform base URL |
NATS_URL | YES | nats://localhost:4222 | Event subscriptions |
RELOOP_API_KEY | Prod | — | API key for the org that owns the sender domain(s); used by reloop-email |
RELOOP_SENDER_DOMAIN | Prod | — | System product mail From domain (auth, billing, invites) |
ONBOARDING_TEST_DOMAIN | Prod | — | Onboarding “Send email” From domain only (can differ) |
Commands
| Command | Description |
|---|---|
bun be:email:dev | Start dev server with hot reloading |
bun run --filter=be-email build | Compile production bundle |
bun run --filter=be-email start | Run compiled production build |
bun run --filter=be-email check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Triggers | Subscribes to NATS subjects (auth.*, billing.*, etc.) |
| Delivery | Sends via the mail pipeline using RELOOP_API_KEY when set |
| Schema | email_log in packages/db/src/schema/email.ts |
Next
Was this page helpful?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.