Sales Automation
outreach followup
How to Build an AI Cold Email Writer
Generate personalized cold emails using AI research on each prospect.
Jay Banlasan
The AI Systems Guy
I built this system to generate personalized cold emails using ai research on each prospect. This ai cold email writer personalized outreach approach scales personalized outreach without losing the human touch.
Outreach that feels automated gets ignored. Outreach that feels personal gets replies. This delivers personal at scale.
What You Need Before Starting
- Python 3.8+ with requests
- Anthropic API key
- Email sending service (SendGrid or SMTP)
- Prospect database or CRM export
Step 1: Load Prospect Data
import csv
def load_prospects(path):
prospects = []
with open(path) as f:
for row in csv.DictReader(f):
prospects.append({
"email": row["email"], "name": row["name"],
"company": row["company"], "title": row.get("title", ""),
})
return prospects
Step 2: Research Each Prospect
import anthropic
from dotenv import load_dotenv
load_dotenv()
client = anthropic.Anthropic()
def research(prospect):
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=512,
system="Research this prospect. Find personalization angles and likely problems.",
messages=[{"role": "user", "content": f"{prospect['name']} at {prospect['company']} ({prospect['title']}). Find talking points."}]
)
return message.content[0].text
Step 3: Generate Personalized Outreach
def write_message(prospect, research_data, msg_type):
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=512,
system="Write personalized outreach. Under 100 words. One clear ask. No generic flattery.",
messages=[{"role": "user", "content": f"To: {prospect['name']} at {prospect['company']}. Research: {research_data}. Type: {msg_type}."}]
)
return message.content[0].text
Step 4: Schedule Follow-Ups
import sqlite3
from datetime import datetime, timedelta
db = sqlite3.connect("outreach.db")
SCHEDULE = [3, 7, 14] # days
def schedule_followups(email, initial_msg):
for i, days in enumerate(SCHEDULE):
send_at = datetime.now() + timedelta(days=days)
db.execute("INSERT INTO followup_queue VALUES (?,?,?,?)",
(email, f"followup_{i+1}", send_at.isoformat(), "pending"))
db.commit()
What to Build Next
Add reply detection. When a prospect replies, pause their sequence and alert you to respond personally.
Related Reading
- How to Use AI for Cold Email Personalization - how AI transforms email marketing operations
- AI for Email Marketing Automation - how AI transforms email marketing operations
- The Cold Start Problem in AI Operations - operational AI systems that run themselves
Want this system built for your business?
Get a free assessment. We will map every system your business needs and show you the ROI.
Get Your Free Assessment