Full-Stack Developer•Professional Case Study

Mailer System & Lead Automation

CEAR Latinoamericano

Proprietary high-throughput email prospecting and nurture platform directly integrated with CEAR Latinoamericano's internal lead database for arbitration and executive programs, featuring Unlayer visual builder, BullMQ queues, and real-time SendGrid analytics.

Motor de Envíos Transaccionales & Prospección
Panel principal del sistema Mailer
[1/5]Panel principal del sistema Mailer
Stack Tecnológico del Proyecto (Frontend, Backend & DevOps)
Frontend & BuilderClient & Templates
Next.jsApp Router / SSR
TypeScriptTipado Estricto
Unlayer SDKDrag & Drop Builder
Tailwind CSSDiseño & Dark Theme
Backend & ColasAsync Workers & Inbox
NestJSModular API / Core
BullMQGestor de Colas
RedisBroker en Memoria
Inbox PatternIdempotencia 1K/min
Entregabilidad & DatosCloud & On-Prem
SendGrid APIDespacho & Webhooks
PostgreSQLLeads & Métricas ACID
Docker VPSContenedores On-Prem
DNS HardenedSPF / DKIM / DMARC
Dispatch Rate
1,000 / min
Reliability
Inbox Pattern
Real Conversion
10 Clients
Deliverability
SendGrid + DNS

The Challenge / Business Need

CEAR Latinoamericano needed an independent, self-hosted solution to communicate at scale with prospective leads, legal experts, and alumni without recurring per-contact subscription fees from third-party marketing tools. Key objectives included:

  • Native synchronization with the internal lead database to target campaigns for specialized arbitration and postgraduate offerings.
  • Integrating a drag-and-drop visual email builder with Unlayer, supporting dual desktop/mobile viewports and dynamic merge tags.
  • Reliably dispatching high-volume batches (1,000 emails/minute) without overloading on-premise CPU or freezing transactional services.
  • Capturing opens, link clicks, and intent signals in real time to empower sales and admissions to convert high-ticket arbitration cases.

Technical Architecture & Decisions

Decoupled, event-driven architecture engineered for high-throughput transactional campaigns:

Capa 01 • Experiencia & Plantillas

Frontend & Visual Builder (Next.js & Unlayer SDK)

Next.js (App Router)TypeScriptUnlayer SDKTailwind CSS
Administrative panel built with Next.js (App Router) and TypeScript offering an intuitive campaign workflow and recipient filtering.
Embedded Unlayer drag-and-drop builder enabling responsive email design and instant dual-screen previewing.
Secure dynamic variable injection ({{name}}, {{course}}, {{offer}}) and HTML sanitization compatible with Outlook and Gmail.
Capa 02 • Procesamiento Asíncrono

Backend & Resilient Queues (NestJS, BullMQ & Inbox Pattern)

NestJS APIBullMQRedisPatrón Inbox (Idempotencia)
Modular microservices with NestJS and BullMQ backed by Redis to dispatch bulk batches across dedicated workers without blocking the main event loop.
Implementation of the Inbox / Outbox Pattern guaranteeing idempotency: zero lost or duplicated emails across network retries.
Strict per-minute rate limiting and exponential backoff policies to safeguard sender domain reputation.
Capa 03 • Entregabilidad & Streaming

Deliverability & Webhooks (SendGrid & DNS Security)

SendGrid APIWebhooks LiveSPF / DKIM / DMARCPixel Tracking
High-throughput cloud email delivery powered by SendGrid API with low latency and optimal routing.
Real-time event streaming ingesting delivery, open, click, bounce, and unsubscribe webhooks.
Hardened DNS records (SPF, DKIM, DMARC) across corporate domains to guarantee direct inbox placement instead of Spam.
Capa 04 • Base de Datos & On-Premise

Database & On-Premise Infrastructure (PostgreSQL & Docker)

PostgreSQL ACIDDocker ComposeVPS On-PremiseBase de Leads
PostgreSQL schema optimized for audiences, lead segmentation, suppression lists, and aggregated campaign performance.
Full containerization with Docker Compose unifying NestJS API, Redis workers, and database on an On-Premise VPS.
Absolute sovereignty over institutional lead data with zero variable per-contact licensing costs.

Key Engineering Challenges Overcome

01

Zero-Loss Resilient Dispatch with Inbox Pattern & BullMQ

Completely decoupled email dispatch into background Redis workers via BullMQ, combining transactional Inbox patterns to guarantee idempotent, controlled execution at 1,000 emails/min.

02

Real-Time Streaming Ingestion of SendGrid Webhooks

Engineered an asynchronous webhook receiver with deduplication and debouncing to log engagement events and update analytics dashboards without locking relational tables.

03

Unlayer Visual Builder with Dynamic Personalization

Seamlessly embedded Unlayer SDK with merge tag interpolation, generating cross-client HTML compatible with legacy Outlook desktop, modern Gmail, and Apple Mail.

Mailer System Gallery

Screenshots of the main dashboard, campaigns, email templates and deliverability metrics.

Panel principal del sistema Mailer
[1/5]Panel principal del sistema Mailer
Back to Projects
Infraestructura Interna de Alto Rendimiento