Skip to content

Eternals Mailer

In Progress

Eternals Mailer is a scalable, self-hosted email delivery service built with NestJS. It handles transactional and system emails with queue-based processing, retry logic, and template-driven sending — no third-party providers required.

LayerTechnology
ApplicationNestJS
DatabasePostgreSQL
QueueRedis
  • Token-based authentication — Secure API access with scoped tokens
  • Queue-based email processing — Reliable delivery via Redis-backed job queues
  • Template-driven emails — Define reusable templates with variable substitution
  • Retry & failure handling — Automatic retries with configurable backoff
  • Environment-based configuration — 12-factor app compatible
  • Webhook callbacks — Delivery status notifications
  • OTP and authentication emails
  • Notifications and system alerts
  • Inter-service communication emails
  • Scheduled digest emails
Terminal window
API Request → Auth Middleware → Email Queue (Redis) → Worker → SMTP Delivery
PostgreSQL (audit log)
Terminal window
docker run -d \
-e DATABASE_URL=postgresql://user:pass@db:5432/mailer \
-e REDIS_URL=redis://redis:6379 \
-e SMTP_HOST=smtp.example.com \
-p 3000:3000 \
eternals/mailer:latest
Terminal window
POST /api/emails
Authorization: Bearer <token>
Content-Type: application/json
{
"to": "user@example.com",
"template": "otp",
"variables": {
"code": "123456",
"expires_in": "10 minutes"
}
}
Terminal window
{
"id": "em_01j...",
"status": "queued",
"created_at": "2026-04-13T00:00:00Z"
}

Eternals Mailer aims to become a fully self-hosted alternative to email service providers like SendGrid and Mailgun — with deep integration into the Eternals ecosystem and complete audit trails for every email sent.