Email

Set up, configure, and run the Reloop platform email microservice locally.

Complete Base Setup First

Ensure you've finished the Setup — before proceeding.

Not the same as Mail

Email sends platform notifications to Reloop users (invites, password resets). Mail is the customer-facing send API for their audiences.

Service Overview

Platform transactional emails triggered by NATS events (invites, OTPs, billing alerts).

PropertyValue
Directoryapps/backend/email
Port8022
Local URLhttps://local.reloop.sh/api/email
Swagger UIhttps://local.reloop.sh/api/email/openapi
StackElysiaJS Redis NATS

Quick Start

Run from the monorepo root:

bun be:email:dev

The service starts with hot reloading on port 8022.

Environment Configuration

Variables live in apps/backend/email/.env. Running bun env:setup from the root auto-populates this file.

EMAIL_PORT=8022
PORT=8022
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
RELOOP_API_KEY=
RELOOP_SENDER_DOMAIN=
NODE_ENV=development

Reference Table

VariableRequiredDefaultNotes
EMAIL_PORT / PORTYES8022Listening port
BASE_URLYEShttps://local.reloop.shPlatform base URL
NATS_URLYESnats://localhost:4222Event subscriptions
RELOOP_API_KEYYESInternal key for send authorization
RELOOP_SENDER_DOMAINYESFrom-address domain

Development Commands

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

Architecture

LayerDetail
TriggersSubscribes to NATS subjects (auth.*, billing.*, etc.).
DeliverySends via the mail pipeline using RELOOP_API_KEY.
Schemaemail_log in packages/db/src/schema/email.ts.

Was this page helpful?

Edit this page