For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/setup/backend/mail.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

Mail

Set up, configure, and run the Reloop mail microservice locally.

Outbound transactional email API — send requests, template compilation, tracking, and SMTP handoff.

Run bun setup once from the monorepo root. That starts Docker including SMTP. Mailpit captures local outbound mail at http://localhost:8025.

Overview

PropertyValue
Directoryapps/backend/mail
Port8015
Local URLhttps://local.reloop.sh/api/mail
Swagger UIhttps://local.reloop.sh/api/mail/openapi
StackElysiaJS · PostgreSQL · Redis · NATS · BullMQ

Quick start

bun be:mail:dev

Or bun backend:dev / bun dev.

Environment

apps/backend/mail/.env — from bun setup / bun env:setup.

PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8015
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
KUMOMTA_HTTP_URL=http://localhost:8020
TRACKING_SECRET=reloop_tracking_secret_default_123
NODE_ENV=development
VariableRequiredDefault
PG_URLYESpostgresql://...
REDIS_URLYESredis://...
PORTYES8015
KUMOMTA_HTTP_URLYEShttp://localhost:8020
TRACKING_SECRETNoSigns tracked link and open-pixel tokens
NATS_URLYESnats://localhost:4222

Commands

CommandDescription
bun be:mail:devStart dev server with hot reloading
bun run --filter=be-mail buildCompile production bundle
bun run --filter=be-mail startRun compiled production build
bun run --filter=be-mail check-typesTypeScript type-check

Architecture

LayerDetail
Send pipelineValidates API keys, compiles templates, injects tracking links
QueuesBullMQ workers dispatch via Redis (mail-queue, mail-retry-queue)
MTA handoffDelivers to the SMTP engine on port 8020
Schemaemail_log in packages/db/src/schema/email.ts

Next

Was this page helpful?

Edit this page