Work / Case study
Tooling · Cloudflare Workers · Node.js
Mail Merge & Tracker
A small business needed to send one personal email to every customer and see who opened it and who clicked, without paying for a monthly email platform. I built a mail-merge script and a tracking service on Cloudflare's edge network to do it.
- Client
- Clothing retailer
- My role
- Solo: design & build
- Built
- October 2026
- Hosting cost
- Cloudflare free tier
The problem
Personal emails, real numbers, no subscription
What the owner wanted
- Emails that greet each customer by name, sent from their own address
- To know which campaign got opened and which links got clicked
- Something a non-technical team member could run alone
Constraints
- No monthly fee for a full marketing platform
- Customer email addresses must not sit on someone else's server
- Tracked links must only ever go to the store's own website
How it works
Two pieces: a sender and a tracker
The sender runs on the owner's computer. The tracker is a tiny Cloudflare Worker that counts events. The two share only anonymous codes, never addresses.
Sending
contacts.csv and an HTML email with {{name}} placeholderspreview.html, sending nothingfailed.txtTracking
/o/c checks the target against an allow-list, then redirectsThe sender in action
$ node mailmerge.js --dry-run Tracking campaign: winter-drop [1/3] Would send to ayesha@example.com (subject: "Hi Ayesha, the winter drop is here") [2/3] Would send to tanvir@example.com (subject: "Hi Tanvir, the winter drop is here") [3/3] Would send to nusrat@example.com (subject: "Hi Nusrat, the winter drop is here") Done. Rendered: 3, failed: 0.
Sample contacts. The first email is also saved to preview.html.
Decisions I'm proud of
- Privacy by design. The tracker only sees short codes made with HMAC-SHA256 and a secret salt that stays on the sender's computer. Matching codes to people happens in the dashboard viewer's browser from a local file, which is never uploaded.
- No open redirect. Click links only redirect to hosts on an allow-list, so spammers can't borrow the tracker.
- Safe by default. A dry run and a preview file come before every real send.
- Hand-off ready. Shipped as a downloadable kit with plain-English setup steps for Mac and Windows.
Interactive demo
Play with the dashboard
This is a copy of the real dashboard running on made-up sample data in your browser. Switch campaigns, simulate opens and clicks, and try the link builder.
Mail Tracker
Updated just nowAll campaigns
People in this campaign
| Person | Opens | Clicks | Last activity |
|---|
Simulate activity
Pretend a random person in this campaign opens the email or clicks a link.
Link builder
Allowed hosts in this demo: shop.example.com. Try another site to see it refused.
The real dashboard is private and protected by a secret key, so this demo never touches it.
Free download
Get the kit and use it yourself
The whole project, ready to run: the mail-merge sender, double-click launchers and the optional tracker. Pick the version for your computer. Each one is about 15 KB, free, MIT licensed.
- Mail-merge sender
- Sample contacts and email template
- Setup, Preview and Send launchers
- Optional Cloudflare tracker with dashboard
- Step-by-step README
- Install Node.js
Download the LTS version from nodejs.org and install it with the default options. You only do this once.
- Unzip the kit
Right-click
MailMerge-Kit-Windows.zip> Extract All. It won't run from inside the zip. - Double-click
1 - Setup.batIt installs what the kit needs and opens your settings in Notepad.
If you see "Windows protected your PC", click More info > Run anyway. The script only works inside the kit folder.
- Fill in your settings and save
See the settings table below. Change them later with
Edit settings.bat. - Add your people and your message
Open
sender\contacts.csvin Excel or Notepad (columns:name,email,business) and editsender\template.html. - Preview, then send
Double-click
2 - Preview.bat: nothing is sent, and the first email opens in your browser. When it looks right, double-click3 - Send.batand typeSEND.
Your settings
- Install Node.js
Download the LTS version from nodejs.org and run the installer. You only do this once.
- Unzip the kit
Double-click
MailMerge-Kit-Mac.zipin Downloads. You'll get aMailMerge-Kit-Macfolder. - Open
1 - Setup.commandIt installs what the kit needs and opens your settings in TextEdit.
The first time, macOS may say it's from an unidentified developer. Right-click the file > Open > Open. You do this once per file. On newer macOS versions, go to System Settings > Privacy & Security and click Open Anyway.
- Fill in your settings and save
See the settings table below. Your settings file is hidden in Finder, so change it later with
Edit settings.command. - Add your people and your message
Open
sender/contacts.csvin Numbers, Excel or TextEdit (columns:name,email,business) and editsender/template.html. - Preview, then send
Open
2 - Preview.command: nothing is sent, and the first email opens in your browser. When it looks right, open3 - Send.commandand typeSEND.
Your settings
Optional: turn on open & click tracking
Tracking is off until you deploy your own tracker, so your data never goes to anyone else. You need a free Cloudflare account. Open a terminal (Windows: Command Prompt, Mac: Terminal) in the kit's tracker folder and run:
Then set TRACKER_URL and TRACKED_HOSTS in your settings. Your dashboard is at https://mail-tracker.YOUR-NAME.workers.dev/dashboard?key=YOUR_PASSWORD.
Only email people who agreed to hear from you, and keep the unsubscribe line in the template. A normal Gmail account can send about 500 emails a day. Never share your settings file: it holds your email password.
What I learned
Honest numbers beat pretty numbers
Opens are a hint, clicks are evidence
Apple Mail and Gmail pre-load or proxy images, so open counts can be inflated or hidden. I made the dashboard lead with click rate and said so plainly in the kit's guide.
Design for the person who runs it
The hardest part wasn't code but making setup work for someone who had never opened a terminal: drag-the-folder instructions, an App Password guide and clear error files.
Built with
- Node.js
- Nodemailer (SMTP)
- Cloudflare Workers
- Workers KV
- Wrangler
- Vanilla JS dashboard
- HTML email
Need a tool like this?
I build small, focused tools that save businesses money, from email and tracking to stores and dashboards.