MERN MailA MERN email campaign manager for lead generation outreach

A case study in building outreach email on top of the sender's own SMTP accounts, with templates, per-send audit logs and two levels of access, in a TypeScript MERN stack.

Category
Full Stack
Industry
Sales and lead generation
Platform
Web application
Status
Private project
  • 2access roles: Admin and User
  • Multi-accountSMTP with app passwords
  • Every sendwritten to an audit log
  • Nodemailerdelivery from the user's own mailbox
MERN Mail
MERN Mail dashboard with charts of email send statistics and a sidebar for templates, SMTP accounts, logs and profile
Overview

MERN Mail: an email campaign manager for lead generation outreach

MERN Mail is a MERN email campaign manager I built in TypeScript so outreach for lead generation goes out from real mailboxes, from reusable templates, with a record of every send.

Users connect their own SMTP accounts with app passwords, write reusable templates and send through Nodemailer, and every email is written to an audit log. Admins oversee all users and the global log, and dashboards chart send statistics for both roles. It runs on React, Node.js and MongoDB with JWT and bcrypt authentication and a crypto-secured forgot-password flow.

The point of the design is that mail never leaves through a third-party bulk sender. It goes out from the mailbox a recipient can reply to, and the app keeps the shared record that a personal inbox cannot.

Role
Full-stack developer
Industry
Sales and lead generation
Audience
Teams running email outreach, and the admins who oversee them
Platform
Web application
Type
Full-stack web application
Category
Full Stack
Stack
React.js, Node.js, TypeScript, MongoDB
Status
Private project
The challenge

The outreach problem MERN Mail solves: no shared record of what went out

Cold outreach for lead generation is repetitive work done by hand in an ordinary inbox, and once a team shares it, nobody can say for sure what has already been sent.

The same introduction gets pasted again and again, sent from whichever account happens to be signed in, with no shared record of who was contacted and when. Once more than one person does it, the team loses track of what has gone out.

Bulk-mail services solve the volume but send from their own infrastructure, which is not what outreach from a person's real mailbox needs. The tool I wanted kept mail going out through the sender's own accounts, made templates reusable, and gave whoever ran the operation a single view of every message sent by every user.

How things worked before MERN Mail, compared with MERN Mail
Before MERN MailWith MERN Mail
The same introduction pasted by hand again and againReusable templates written once
Mail sent from whichever account is signed inSeveral SMTP accounts, chosen per send
No shared record of who was contactedAn audit log entry for every email
No oversight across the people doing outreachAn admin view of all users and the global log

The brief I set myself

  • Real mailboxesSend from the user's own accounts.
  • ReusableTemplates instead of copy and paste.
  • AuditableEvery send recorded, with sender and account.
  • Safe credentialsApp passwords, never the main password.
My role

My role: building MERN Mail across the TypeScript stack

I built MERN Mail across the whole stack in TypeScript, from the React interface to the Node.js API, the MongoDB data model and the Nodemailer sending pipeline.

That covered the React interface with Tailwind CSS and shadcn/ui, the Node.js API, the MongoDB data model, authentication and password reset, the Nodemailer sending pipeline, and the statistics dashboards for users and admins.

Much of the work sat at the boundaries: what the server is allowed to hold for a user's mailbox, what each role is allowed to read, and how a single send becomes both a delivered email and a log entry.

Scope of work on MERN Mail
FrontendThe React interface with Tailwind CSS and shadcn/ui, including the statistics dashboards for users and admins.
APIThe Node.js API, with every route checking the role carried in the token.
DataThe MongoDB model for users, SMTP accounts, templates and the audit log.
SendingThe Nodemailer pipeline, sending through the SMTP account picked for each email.
SecurityJWT authentication, bcrypt password hashing and a crypto-secured password reset.
How it works

How sending an outreach email works in MERN Mail

A send in MERN Mail follows the same four steps every time: connect a mailbox, write a template, send through the chosen account, and find the message in the log.

  1. Step 1

    Connect a mailbox

    The user adds an SMTP account with an app password generated by their email provider. Several accounts can be connected.

    Credentials
    App passwordRevocable at the provider
  2. Step 2

    Write a template

    Outreach messages are saved as reusable templates, so the introduction is written once rather than pasted into every email.

    Templates
    CreateReuseManage
  3. Step 3

    Send from the right account

    The user picks one of their connected accounts for the send, and Nodemailer delivers the email through that account's SMTP server.

    Delivery
    NodemailerUser's own SMTP
  4. Step 4

    Find it in the log

    The send is recorded with the sender and the account it went through. The user sees their own entries, and an admin sees every entry.

    Visible to
    User: own entriesAdmin: all entries
Key features

MERN Mail features for email outreach and oversight

The features split between the person sending outreach and the admin overseeing it, and both read from the same audit log.

Multi-account SMTP

Connect several sending accounts with app passwords and pick one per email.

Template management

Save outreach messages as reusable templates instead of pasting them into every email.

Sending through Nodemailer

Each email goes out through the selected account, so replies come back to a real inbox.

Audit logs for every email

Every send is recorded with its sender and account, per user and globally for admins.

Statistics dashboards

Charts of send statistics, built from the same log as the history.

Admin and User roles

Users manage their own outreach, and admins oversee every user and the global log.

JWT and bcrypt authentication

Token-based sessions that carry the role, and passwords stored only as bcrypt hashes.

Profile and password reset

Profile management and a forgot-password flow secured with tokens from Node's crypto module.

Architecture

How MERN Mail is built: Nodemailer, roles and an audit log

Four decisions shaped MERN Mail: sending from the user's own SMTP accounts, keeping the access model to two roles, logging every send, and typing both ends.

Delivery

Nodemailer on the user's own SMTP accounts

Sending through each user's SMTP account means the email arrives from a real mailbox the recipient can reply to, and the user's sent folder stays a true record. A user can connect several accounts and choose one per send. Accounts are added with app passwords, so the main account password never enters the app and an app password can be revoked from the provider without touching anything else.

Access

Two roles with different scopes

The access model is deliberately small: a User manages their own SMTP accounts, templates and sent mail, and an Admin can see every user and the global email log. Two levels covered what the product needed, and every API route checks the role from the token rather than trusting what the interface chooses to show. For a three-tier version of the same idea, see the Team Management System, which separates Admin, Manager and Team Member.

Data

An audit log written on every send

Each email the app sends is recorded with the sender and account it went through. Users read their own entries, and admins read all of them. The dashboard statistics are built from the same log, so the charts and the history can never disagree about how much mail went out.

Types

TypeScript on both sides

Templates, accounts, log entries and users pass between React and the API many times in a single session. Writing both ends in TypeScript caught mismatched fields while I was building, before they could reach a send.

The MERN Mail tech stack

Technologies used in MERN Mail and what each one does
TechnologyWhat it does in MERN Mail
React.jsThe interface: templates, SMTP accounts, logs, profile and the statistics dashboards.
Node.jsThe API that stores accounts and templates, sends mail and scopes every query by role.
TypeScriptShared shapes for templates, accounts, log entries and users on both ends.
MongoDBUsers, SMTP accounts, templates and the single audit log collection.
Tailwind CSSStyling for the dashboard and every management screen.
Shadcn/UIAccessible form, table and dialog components, restyled with Tailwind CSS.
JWTAuthentication, carrying the role that every API route checks.
NodemailerSending each email through the SMTP account the user selected.
bcryptPassword hashing, so passwords are never stored in plain text.
cryptoRandom, unguessable tokens for the forgot-password links.
Challenges

Challenges in building MERN Mail, and how I solved them

Three of the hard parts: holding credentials for someone else's mailbox, a password reset that cannot be guessed, and one log serving two audiences.

Holding credentials for someone else's mailbox

Problem

To send as a user, the server needs SMTP credentials for that user's account. Asking people for their real email password would be a serious risk for them and an obvious reason not to use the tool.

Solution

Accounts are connected with app passwords instead. An app password only works for mail access, is generated by the email provider, and can be revoked there at any moment, so a user stays in control of what the app can do with their mailbox.

A password reset that cannot be guessed

Problem

Forgot-password links are a common way into an account. A reset link built from anything predictable, such as a user ID or a timestamp, can be forged by someone who never had access to the inbox.

Solution

Reset tokens are generated with Node's crypto module, so the link carries a random value that cannot be derived from anything about the user. Passwords themselves are stored only as bcrypt hashes.

One log, two audiences

Problem

Users need to see what they sent, and admins need to see everything. Two separate logs would drift apart, and a single log returned in full to everyone would expose each user's outreach to the others.

Solution

There is one log collection, and the API scopes every query by role: a User's request is filtered to their own entries, an Admin's is not. The same scoping feeds the dashboard charts, so each person sees statistics only for the mail they are allowed to see.

Results

Results: MERN Mail makes email outreach repeatable and auditable

MERN Mail turns outreach into a repeatable process: write a template once, send it from the right account, and find every message afterwards in one log.

An admin can review that log across the whole team, and each user sees exactly their own share of it. MERN Mail shares its stack with my Transaction Tracker finance app, but the hard parts here were different: credentials for third-party mailboxes, delivery through external SMTP servers, and an audit trail that had to hold up for oversight.

What's next for MERN Mail

Ideas for a next version include scheduled sends and per-recipient personalisation fields in templates, which would need to be confirmed before they are described as planned.

FAQ

MERN Mail email campaign manager: frequently asked questions

Short answers to the questions people ask most about MERN Mail, how it sends email, and how it treats mailbox credentials.

What is MERN Mail?

MERN Mail is an email campaign manager for lead generation outreach. Users connect their own SMTP accounts, write reusable templates and send through them, every email is written to an audit log, and admins can oversee all users and the global log.

What is MERN Mail built with?

A TypeScript MERN stack: React with Tailwind CSS and shadcn/ui, Node.js and MongoDB, with Nodemailer for sending, JWT for authentication, bcrypt for password hashing and Node's crypto module for password reset tokens.

How does MERN Mail send email?

Through Nodemailer, using the SMTP account the user picks for that send. The email arrives from a real mailbox the recipient can reply to, rather than from a bulk-mail service.

Does MERN Mail need my email password?

No. Accounts are connected with app passwords generated by the email provider. An app password only gives mail access and can be revoked at the provider at any time, so the main account password never enters the app.

What can an admin see in MERN Mail?

An admin can see every user and the global email log. A regular user sees only their own SMTP accounts, templates and sent mail, and the API applies that scope to every query, including the dashboard statistics.

How is MERN Mail different from Transaction Tracker?

They share a TypeScript MERN stack, but MERN Mail is about sending through external SMTP servers and keeping an audit trail for oversight, while Transaction Tracker is a private record of one person's income and spending.

Who built MERN Mail?

Muhammad Abdullah Awais, a full-stack developer based in Pakistan. I built MERN Mail across the stack, and I am available for freelance and full-time work on applications like it.

Available for new builds

Need a full-stack developer for a product like this?

I work remotely with teams in the US, Canada, the UK, Europe and the Gulf, and with clients across Pakistan. Based in Pakistan (PKT, UTC+5), available for freelance and full-time roles.