Skip to content

Subodh26oct/Automated_outreach_platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Jinja2 Brevo CLI License

πŸš€ Automated Outreach Pipeline

Enterprise-grade B2B lead generation & cold outreach engine β€” fully automated, end-to-end.

Feed it a single company domain β†’ Get personalized outreach emails delivered to verified decision-makers at lookalike companies. Zero manual steps.

Quick Start β€’ Architecture β€’ Pipeline Stages β€’ Demo β€’ Engineering β€’ Roadmap


πŸ“Œ Problem Statement

Traditional outbound prospecting is manual, fragmented, and time-intensive:

Manual Workflow Time Spent
πŸ” Researching lookalike companies ~45 min
πŸ‘€ Finding decision-maker contacts ~60 min
πŸ“§ Resolving verified work emails ~30 min
✍️ Writing & sending personalized emails ~90 min
Total per campaign ~3–4 hours

This pipeline reduces it to a single command that executes in under 2 minutes.


πŸ›οΈ Architecture & Data Flow

                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚   🌐 Seed Domain     β”‚
                        β”‚   (e.g. wise.com)    β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 1 β€” Company Discovery β”‚
                    β”‚  CUFinder API (Ocean)        β”‚
                    β”‚  Discovers lookalike domains  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 2 β€” Prospect Finder   β”‚
                    β”‚  Prospeo Search Person API   β”‚
                    β”‚  Extracts C-Suite / VP / Dir  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 3 β€” Email Enrichment  β”‚
                    β”‚  Prospeo Enrich Person API   β”‚
                    β”‚  Resolves verified work email β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  πŸ›‘οΈ SAFETY CHECKPOINT        β”‚
                    β”‚  CLI Approval Gate            β”‚
                    β”‚  Human confirms recipients    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 4 β€” Email Delivery    β”‚
                    β”‚  Brevo Transactional SMTP    β”‚
                    β”‚  Jinja2 HTML template render  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each stage's output feeds directly into the next β€” no CSV exports, no copy-pasting, no intermediate tools required.


πŸ—‚οΈ Project Structure

Automated_outreach_platform/
β”‚
β”œβ”€β”€ πŸ“„ main.py                        # CLI entrypoint & pipeline orchestrator
β”‚
β”œβ”€β”€ πŸ“‚ services/                      # Modular API integration layer
β”‚   β”œβ”€β”€ ocean.py                      # Stage 1 β€” Lookalike company discovery (CUFinder)
β”‚   β”œβ”€β”€ prospeo.py                    # Stage 2 β€” Decision-maker extraction (Prospeo)
β”‚   β”œβ”€β”€ eazyreach.py                  # Stage 3 β€” Email verification & enrichment (Prospeo)
β”‚   └── brevo.py                      # Stage 4 β€” Transactional email delivery (Brevo)
β”‚
β”œβ”€β”€ πŸ“‚ templates/                     # Email template assets
β”‚   └── outreach_template.html        # Jinja2 HTML cold-outreach template
β”‚
β”œβ”€β”€ πŸ“‚ models/                        # Data model definitions
β”‚   └── contact.py                    # Contact data structures
β”‚
β”œβ”€β”€ πŸ“‚ utils/                         # Shared utility functions
β”‚   └── helpers.py                    # Helper utilities
β”‚
β”œβ”€β”€ πŸ“‚ screenshots/                   # Pipeline demonstration captures
β”‚   β”œβ”€β”€ pipeline_output.jpg           # Pipeline execution (2-company run)
β”‚   β”œβ”€β”€ pipeline_output_1.png         # Pipeline execution (5-company run)
β”‚   β”œβ”€β”€ safety-checkpoints.png        # Safety gate β€” single contact
β”‚   β”œβ”€β”€ safety-checkpoints-2.png      # Safety gate β€” multi-contact batch
β”‚   β”œβ”€β”€ Brevo_analyst.jpeg            # Brevo real-time delivery dashboard
β”‚   └── statistics.jpeg               # Brevo campaign statistics & metrics
β”‚
β”œβ”€β”€ πŸ“„ requirements.txt               # Python dependencies
β”œβ”€β”€ πŸ“„ .env.example                   # python-dotenv environment template
└── πŸ“„ .env                           # Local credentials (python-dotenv, git-ignored)

⚑ Engineering Highlights

What makes this implementation production-grade rather than a weekend script:

🎨 Decoupled HTML Templating (Jinja2)

Email copy lives in a standalone templates/outreach_template.html file β€” not hardcoded Python strings. Marketing can edit the template without touching business logic. Jinja2 handles personalization tokens ({{ first_name }}, {{ company_name }}, {{ title }}).

πŸ–₯️ Fully Configurable CLI (argparse)

Every pipeline parameter is tunable from the command line. Run quick 2-company test iterations to conserve API credits, or full 10-company campaigns:

python main.py wise.com -c 2 -m 1    # fast test: 2 companies, 1 contact each
python main.py wise.com -c 10 -m 5   # full campaign: 10 companies, 5 contacts each

πŸ›‘οΈ Human Safety Checkpoint

Before any email leaves the system, the pipeline pauses and displays a formatted summary table of every recipient (name, seniority, email). Requires explicit y confirmation β€” preventing accidental mass emails.

πŸ”„ Graceful Error Recovery

Rate limits, timeouts, and API failures for individual companies are caught and logged β€” the pipeline skips the failing target and continues processing the rest. A single flaky API call never kills the entire campaign.

πŸ”‘ Cross-Platform Unicode Safety

Windows CMD/PowerShell terminals using CP1252/ASCII encoding crash on emoji output. This build dynamically reconfigures stdout to UTF-8 and wraps all output in a safe_print() fallback that strips non-BMP characters on legacy terminals.

🧹 Deduplication Engine

Tracks LinkedIn URLs and resolved emails across the entire run. If the same person appears from multiple company queries, they receive exactly one email β€” protecting sender domain reputation.

🧠 Smart Seniority Parsing

Parses Prospeo's nested job_history array to identify the current role's seniority. Filters out Analysts, Seniors, and Associates β€” only C-Suite, VPs, Directors, and Founders get through.


πŸ” Pipeline Stages β€” Deep Dive

Stage 1 β€” Company Discovery (services/ocean.py)

Detail Value
API CUFinder /v2/fcl
Input Seed company domain
Output List of { name, domain } for lookalike companies
Error Handling Timeout protection, non-JSON response fallback, self-domain exclusion

Stage 2 β€” Decision Maker Discovery (services/prospeo.py)

Detail Value
API Prospeo /search-person
Input Company domains from Stage 1
Output Decision-makers with { name, title, seniority, linkedin_url, company }
Filters C-Suite, Vice President, Founder/Owner, Director
Smart Parsing Extracts seniority from nested job_history[].current field

Stage 3 β€” Email Enrichment (services/eazyreach.py)

Detail Value
API Prospeo /enrich-person
Input LinkedIn URLs / Person IDs from Stage 2
Output Verified work email addresses
Safeguards Only VERIFIED status emails pass through, rate-limit delay (1s), deduplication

Stage 4 β€” Email Delivery (services/brevo.py)

Detail Value
API Brevo /v3/smtp/email
Input Enriched contacts from Stage 3
Output Transactional emails with Brevo messageId tracking
Template Jinja2-rendered HTML with personalization tokens
Fallback Inline template if outreach_template.html is missing

πŸ“Έ Demo & Screenshots

πŸ–₯️ Pipeline Execution β€” 2-Company Quick Run

Shows Stage 1 β†’ 3 with 2 lookalike companies (Adyen, Airwallex) discovered for the seed domain wise.com:

Pipeline Output β€” Quick Run


πŸ–₯️ Pipeline Execution β€” Full 5-Company Run

Full campaign targeting 5 companies (Adyen, Airwallex, Google, Klarna, Monzo). Note Klarna hitting a rate limit β€” the pipeline gracefully skips it and continues:

Pipeline Output β€” Full Run


πŸ›‘οΈ Safety Checkpoint β€” Single Contact

Interactive confirmation gate showing 1 queued recipient before email dispatch:

Safety Checkpoint β€” Single


πŸ›‘οΈ Safety Checkpoint β€” Multi-Contact Batch

Batch confirmation for 6 verified decision-makers across multiple companies. All emails dispatched successfully with Brevo message IDs:

Safety Checkpoint β€” Batch


πŸ“Š Brevo Real-Time Analytics Dashboard

Live SMTP delivery dashboard showing 6 events, 6 delivered, 0 bounced β€” 100% deliverability:

Brevo Real-Time Analytics


πŸ“ˆ Campaign Statistics & Metrics

Brevo statistics panel showing 7 total emails sent with 100% delivery rate, 14.29% estimated open rate, 0% bounce rate:

Campaign Statistics


πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • API keys for: CUFinder, Prospeo, Brevo
  • A verified sender domain on Brevo (e.g., caliver.me)

1. Clone the Repository

git clone https://github.com/Subodh26oct/Automated_outreach_platform.git
cd Automated_outreach_platform

2. Install Dependencies

pip install -r requirements.txt

3. Configure Environment (python-dotenv)

cp .env.example .env

Edit the .env file with your credentials (loaded automatically via python-dotenv):

CUFINDER_API_KEY=your_cufinder_api_key_here
PROSPEO_API_KEY=your_prospeo_api_key_here
BREVO_API_KEY=your_brevo_api_key_here
SENDER_EMAIL=name@domain.me
SENDER_NAME=Company Name

4. Run the Pipeline

# Quick test β€” 2 companies, 1 contact per company
python main.py wise.com -c 2 -m 1

# Full campaign β€” 5 companies, 3 contacts each
python main.py wise.com -c 5 -m 3

# View all CLI options
python main.py --help

πŸ› οΈ Technology Stack

Layer Technology Purpose
Language Python 3.10+ Core runtime
CLI argparse Command-line interface & flag parsing
HTTP requests API communication layer
Templating Jinja2 Decoupled HTML email rendering
Config python-dotenv Secure credential management via .env
Company Discovery CUFinder API Lookalike company extraction
Prospect Intelligence Prospeo API Decision-maker search + email enrichment
Email Delivery Brevo SMTP API Transactional email dispatch with tracking

πŸ—ΊοΈ Future Roadmap

Features planned for upcoming iterations to evolve this into a full SaaS-grade outreach platform:

Priority Feature Description
πŸ”΄ P0 Multi-Sequence Campaigns Automated follow-up sequences (Day 1 β†’ Day 3 β†’ Day 7) with smart stop-on-reply
πŸ”΄ P0 CRM Integration HubSpot / Salesforce sync to auto-log outreach activities and update deal stages
🟠 P1 AI-Powered Personalization LLM-generated email copy tailored per recipient using company news + LinkedIn activity
🟠 P1 A/B Testing Engine Template variant testing with statistical significance tracking on open/reply rates
🟑 P2 Web Dashboard React/Next.js dashboard for campaign management, analytics visualization, and team collaboration
🟑 P2 Webhook-Based Tracking Real-time open/click/reply event processing via Brevo webhooks
🟒 P3 Multi-Channel Outreach LinkedIn InMail + Twitter DM integration alongside email campaigns
🟒 P3 Domain Warm-Up Module Automated sender reputation building for new domains to maximize inbox placement
🟒 P3 Rate Limit Intelligence Adaptive request throttling per API provider with token bucket algorithm
πŸ”΅ P4 Team Collaboration Multi-seat accounts with role-based access, campaign sharing, and audit logging
πŸ”΅ P4 CSV/Webhook Export Pipeline output export to CSV, Google Sheets, or custom webhook endpoints

πŸ“ Design Decisions & Trade-offs

Decision Rationale
Prospeo for enrichment instead of Eazyreach Prospeo already provides verified email resolution via /enrich-person, avoiding an additional API dependency while maintaining the same data quality
argparse over click Zero additional dependencies β€” argparse ships with Python stdlib, keeping the install lightweight
Jinja2 templates over f-strings Clean separation of concerns β€” email copy is editable by non-developers without touching Python code
Sequential email sending Deliberate choice over async/parallel to respect Brevo rate limits and maintain predictable delivery ordering
1-second enrichment delay Built-in rate-limit protection between Prospeo enrichment calls to prevent 429 errors

⚠️ Important Notes

  • API Credits: CUFinder and Prospeo have free-tier usage limits. Use -c 2 -m 1 for testing to conserve credits.
  • Sender Verification: Your SENDER_EMAIL domain must be verified in Brevo's dashboard before emails will deliver successfully.
  • Compliance: This tool is for legitimate B2B outreach only. Ensure compliance with CAN-SPAM, GDPR, and local regulations.

πŸ‘¨β€πŸ’» Author

Subodh AI & Software Engineer

GitHub


Built with β˜• and Python β€” from seed domain to signed deal.

About

πŸš€ AI-powered B2B lead generation pipeline β€” discovers lookalike companies, extracts decision-makers, resolves verified emails, and sends personalized outreach. One command, zero manual steps.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors