Cold Email Engine
Automated outbound email pipeline: find leads → enrich contacts → send personalized emails → drip follow-ups.
Pipeline
- Source leads — from CSV, Google Sheets, API scraping, or manual input
- Enrich — find emails via website scraping, Hunter.io, or Apollo
- Personalize — variable substitution in templates ({name}, {company}, {pain_point})
- Send — via Resend, SendGrid, or raw SMTP with rate limiting
- Drip — automated follow-ups at day 3 and day 7
- Track — log all sends, bounces, replies to CSV/Sheets
Requirements
- Email provider API key — Resend (
RESEND_API_KEY), SendGrid, or SMTP credentials
- Verified sending domain — with SPF, DKIM, DMARC configured
- Lead source — CSV file, Google Sheet ID, or API endpoint
Quick Start
# Set environment
export RESEND_API_KEY=your_key
# Send from CSV
node scripts/cold-email-engine.js --source leads.csv --template templates/default.txt --from "Name <hello@yourdomain.com>"
# Dry run (no emails sent)
node scripts/cold-email-engine.js --source leads.csv --template templates/default.txt --dry-run
# Run drip follow-ups
node scripts/cold-email-engine.js --drip --days 3
Configuration
Edit scripts/config.json:
maxPerDay: Daily send limit per domain (default: 25)
delayBetweenMs: Delay between emails in ms (default: 3000)
dripDays: Follow-up schedule [3, 7] days after initial send
suppressionFile: Path to suppression/unsubscribe list
trackingFile: Path to send log
Templates
Templates use {variable} syntax. Available variables:
{first_name}, {last_name}, {email}
{company}, {website}, {city}, {state}
{pain_point} — auto-generated from website analysis
{sender_name}, {sender_title}
Template Example
Subject: {company} — quick question
Hi {first_name},
I noticed {company} {pain_point}. We help businesses like yours
fix that in under a week.
Would it make sense to chat for 10 minutes this week?
{sender_name}
{sender_title}
Compliance
- CAN-SPAM: physical address in footer, unsubscribe mechanism
- GDPR: only email businesses (B2B exemption), honor removal requests
- Rate limits: 25/day per domain, 3-second delay between sends
- Suppression list checked before every send
Scripts
scripts/cold-email-engine.js — Main send engine
scripts/enrich-leads.js — Email finder from websites/domains
scripts/config.json — Configuration
References
- See
references/deliverability.md for domain warmup and inbox placement
- See
references/templates.md for proven email templates by industry
1---2name: cold-email-engine3description: Automated cold email outreach system with lead enrichment, personalized templates, drip sequences, and CAN-SPAM compliance. Use when building outbound sales pipelines, prospecting businesses, automating email campaigns, enriching leads with contact info, setting up drip follow-ups, or managing cold outreach at scale. Supports Resend, SendGrid, or any SMTP provider.4---56# Cold Email Engine78Automated outbound email pipeline: find leads → enrich contacts → send personalized emails → drip follow-ups.910## Pipeline11121. **Source leads** — from CSV, Google Sheets, API scraping, or manual input132. **Enrich** — find emails via website scraping, Hunter.io, or Apollo143. **Personalize** — variable substitution in templates ({name}, {company}, {pain_point})154. **Send** — via Resend, SendGrid, or raw SMTP with rate limiting165. **Drip** — automated follow-ups at day 3 and day 7176. **Track** — log all sends, bounces, replies to CSV/Sheets1819## Requirements2021- **Email provider API key** — Resend (`RESEND_API_KEY`), SendGrid, or SMTP credentials22- **Verified sending domain** — with SPF, DKIM, DMARC configured23- **Lead source** — CSV file, Google Sheet ID, or API endpoint2425## Quick Start2627```bash28# Set environment29export RESEND_API_KEY=your_key3031# Send from CSV32node scripts/cold-email-engine.js --source leads.csv --template templates/default.txt --from "Name <hello@yourdomain.com>"3334# Dry run (no emails sent)35node scripts/cold-email-engine.js --source leads.csv --template templates/default.txt --dry-run3637# Run drip follow-ups38node scripts/cold-email-engine.js --drip --days 339```4041## Configuration4243Edit `scripts/config.json`:44- `maxPerDay`: Daily send limit per domain (default: 25)45- `delayBetweenMs`: Delay between emails in ms (default: 3000)46- `dripDays`: Follow-up schedule [3, 7] days after initial send47- `suppressionFile`: Path to suppression/unsubscribe list48- `trackingFile`: Path to send log4950## Templates5152Templates use `{variable}` syntax. Available variables:53- `{first_name}`, `{last_name}`, `{email}`54- `{company}`, `{website}`, `{city}`, `{state}`55- `{pain_point}` — auto-generated from website analysis56- `{sender_name}`, `{sender_title}`5758### Template Example59```60Subject: {company} — quick question6162Hi {first_name},6364I noticed {company} {pain_point}. We help businesses like yours 65fix that in under a week.6667Would it make sense to chat for 10 minutes this week?6869{sender_name}70{sender_title}71```7273## Compliance7475- CAN-SPAM: physical address in footer, unsubscribe mechanism76- GDPR: only email businesses (B2B exemption), honor removal requests77- Rate limits: 25/day per domain, 3-second delay between sends78- Suppression list checked before every send7980## Scripts8182- `scripts/cold-email-engine.js` — Main send engine83- `scripts/enrich-leads.js` — Email finder from websites/domains84- `scripts/config.json` — Configuration8586## References8788- See `references/deliverability.md` for domain warmup and inbox placement89- See `references/templates.md` for proven email templates by industry