PropSpaceX Mail Service
Asynchronous notification microservice — RabbitMQ job queues with retries and dead-letter handling, template rendering, and SMTP delivery via Nodemailer.
System Architecture
Services publish mail jobs over gRPC into RabbitMQ. Workers consume with exponential backoff, render templates, and deliver via Nodemailer/SMTP. Exhausted retries land in a dead-letter queue; every attempt is logged to MongoDB.
Database Design
Jobs reference versioned templates; each delivery attempt is logged separately so bounces and retries stay auditable.
Engineering Challenges
Guaranteed delivery
Exponential backoff with dead-letter queues means a transactional email is never silently dropped.
Template management
Versioned, localized templates rendered at send time from job payloads.
Provider rate limits
Queue throttling keeps outbound volume inside SMTP provider limits during spikes.
Bounce handling
Webhook processing for bounces and complaints protects sender reputation automatically.