π§ Technologies Used
Node.js
Express.js
AWS SQS
Nodemailer
MongoDB
π¦ System Overview
This email delivery system is built to queue, process, and send transactional emails reliably using AWS SQS and Nodemailer. It handles load efficiently, decouples send operations, and ensures delivery even under high volumes.
βοΈ Key Features
-
Queue emails using
AWS SQSfor reliable processing -
Consume and send emails using
Nodemailerwith custom SMTP setup - RESTful API to enqueue email jobs with flexible payload
- Error handling middleware for clean exception flow
π Folder Structure
βββ πsrc
βββ πconfig
βββ aws.js
βββ database.js
βββ email.js
βββ πcontrollers
βββ emailController.js
βββ πmiddlewares
βββ errorHandler.js
βββ πmodels
βββ emailLogs.js
βββ πpublic
βββ index.html
βββ sendMail.html
βββ πroutes
βββ emailRoutes.js
βββ πservices
βββ emailLogService.js
βββ emailService.js
βββ sqsConsumer.js
βββ sqsProducer.js
βββ πutils
βββ constants.js
βββ app.js
βββ consumer.js
π How It Works
- API receives email request and pushes it to the SQS queue
- Consumer reads the queue and sends email using SMTP/Nodemailer
- Status and failures are logged; retries can be managed
π« Example Payload
{
"to": "user@example.com",
"subject": "Welcome to Our Platform",
"html": "Thanks for signing up!
",
"body": "Thanks for signing up!",
"cc": ["cc@example.com"],
"bcc": ["bcc@example.com"],
"attachment": ["https://example.com/file.pdf"]
}
π§ Send an Email
π¨βπ» Developed By
Shivam Kumar β Full-Stack Developer at AAA2 Innovate Pvt. Ltd
Email: shivamraj6136@gmail.com