B2B cold email sequence generator with Intelligence Hierarchy System and Gmail API Integration for foreign trade professionals.
foreign-trade-email-sorter credentialsThis tool implements a 3-tier intelligence system that adapts email content based on the information you have available:
| Mode | Trigger | Approach |
|---|---|---|
| ------ | --------- | ---------- |
| Precise | -c | Full personalization with known company/pain point |
| Auto | -u | Auto-research from company URL |
| Blind | -mail-only | Generic outreach with industry trends |
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlibTAVILY_API_KEY environment variable for website researchcredentials.json from foreign-trade-email-sorter or create new oneSee SETUP.md for detailed setup instructions.
# Run the complete workflow script
.\scripts\run-workflow.ps1
This will guide you through:
# Generate and display emails
.\scripts\b2b-cold.ps1 sequence -mode precise -c "Tech Corp" -p "long lead times"
# Send email directly via Gmail
.\scripts\send-email.ps1 -To "client@example.com" -Subject "Hello" -Body "Email content"
# Or use Python directly
python scripts/gmail_sender.py --to "client@example.com" --subject "Hello" --body "Email content"
# Generate emails
bash scripts/b2b-cold.sh sequence -mode precise -c "Tech Corp" -p "long lead times"
# Send via Gmail API
python3 scripts/gmail_sender.py --to "client@example.com" --subject "Hello" --body "Email content"
| Command | Purpose |
|---|---|
| --------- | --------- |
sequence | Full 3-email sequence with intelligence mode |
first | Email 1: Connection |
second | Email 2: Value |
third | Email 3: Action |
subject | Subject lines only |
followup | Follow-up email |
send | Send queued emails via SMTP (PowerShell only) |
queue | Show pending emails |
clear-queue | Clear send queue |
| Command | Purpose |
|---|---|
| --------- | --------- |
send-email.ps1 | Send email via Gmail API (PowerShell) |
gmail_sender.py | Send email via Gmail API (Python) |
| Option | Description | Example |
|---|---|---|
| -------- | ------------- | --------- |
-i | Industry | textile, electronics, packaging, machinery, consumer, general |
-c | Target company | "Fashion Brand Inc" |
-co | Country | "USA", "Germany" |
-p | Pain point | "long lead time" |
-v | Value proposition | "7-day fast delivery" |
-s | Sender name | "Mike Zhang" |
-sc | Sender company | "ABC Textile Co." |
-u | Target URL | "www.targetclient.com" (auto mode) |
--mail-only | Blind mode | No specific info needed |
If you have foreign-trade-email-sorter configured:
# Copy credentials
copy "..\foreign-trade-email-sorter\credentials.json" "scripts\"
# First run will authorize and save token
python scripts/gmail_sender.py --to "test@example.com" --subject "Test" --body "Hello"
credentials.json to scripts/ folderOn first run, the script will:
scripts/token.jsonFull personalization when you know:
Uses reference-based hooks like "I've been following your company..."
Auto-research from URL when you only have:
The system will:
Generic outreach when you only have:
Uses industry-wide hooks like "Recent regulatory changes in {country} are affecting how {industry} companies approach..."
# Send single email
.\scripts\send-email.ps1 -To "client@example.com" `
-Subject "Quick question about your sourcing" `
-Body "Email content here..."
# Send from file
.\scripts\send-email.ps1 -To "client@example.com" `
-Subject "Hello" `
-BodyFile "email.txt"
python scripts/gmail_sender.py \
--to "client@example.com" \
--subject "Quick question" \
--body "Email content..."
# 1. Generate email
.\scripts\b2b-cold.ps1 first -mode precise -c "Tech Corp" -p "long lead times" > email.txt
# 2. Send email
.\scripts\send-email.ps1 -To "client@example.com" -Subject "Hello" -BodyFile "email.txt"
Each industry includes:
# Generate
.\scripts\b2b-cold.ps1 sequence `
-mode precise `
-i textile `
-c "Fashion Brand Inc" `
-co "USA" `
-p "quality inconsistency" `
-v "7-day fast delivery" `
-s "Mike Zhang" `
-sc "ABC Textile Co."
# Send first email
.\scripts\send-email.ps1 `
-To "client@fashionbrand.com" `
-Subject "Quick question about your textile sourcing" `
-Body "Hi there..."
# Generate
.\scripts\b2b-cold.ps1 sequence -mode auto -u "www.targetclient.com" -co "Germany"
# Send
.\scripts\send-email.ps1 -To "contact@targetclient.com" -Subject "Hello" -BodyFile "generated_email.txt"
google-api-python-client, google-auth-httplib2, google-auth-oauthlibcredentials.json in scripts/ folderforeign-trade-email-writer/
├── scripts/
│ ├── b2b-cold.ps1 # PowerShell email generator
│ ├── b2b-cold.sh # Bash email generator
│ ├── gmail_sender.py # Gmail API sender (NEW)
│ ├── send-email.ps1 # PowerShell wrapper for Gmail (NEW)
│ ├── settings.json # SMTP settings (legacy)
│ └── credentials.json # Gmail API credentials (optional)
├── SKILL.md # This file
├── README.md # Detailed documentation
└── CHANGELOG.md # Version history
MIT License
共 2 个版本