Documentation Index
Fetch the complete documentation index at: https://ahasend.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Batch Processing
Send high-volume personalized emails efficiently using the AhaSend CLI batch processing capabilities.
Overview
Batch processing allows you to:
- Send thousands of personalized emails
- Use concurrent workers for speed
- Track progress in real-time
- Automatically retry failures
- Generate performance metrics
Basic Batch Send
ahasend messages send \
--from noreply@example.com \
--recipients recipients.csv \
--subject "Welcome to {{company}}" \
--html-template welcome.html \
--progress \
--show-metrics
Concurrency Control
# Conservative (1 worker)
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--max-concurrency 1
# High performance (5 workers - default)
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--max-concurrency 5
# Maximum throughput (10 workers)
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--max-concurrency 10
| Concurrency | Emails/Hour | Use Case |
|---|
| 1 | ~3,600 | Testing, low priority |
| 5 | ~18,000 | Standard campaigns |
| 10 | ~36,000 | Maximum throughput |
Progress Tracking
ahasend messages send \
--recipients large-list.csv \
--html-template newsletter.html \
--max-concurrency 5 \
--progress
Error Handling
Automatic Retries
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--max-retries 3
Failed Recipients Recovery
Failed recipients are automatically saved for retry:
# If failures occur, retry with saved file
ahasend messages send \
--recipients ~/.ahasend/failed-2024-01-16-143022.json \
--html-template campaign.html \
--max-retries 5
Template Personalization
Global and Per-Recipient Data
// global-data.json
{
"company_name": "ACME Corp",
"support_email": "support@acme.com"
}
ahasend messages send \
--from noreply@acme.com \
--recipients users.csv \
--subject "{{first_name}}, Welcome to {{company_name}}" \
--html-template welcome.html \
--global-substitutions global-data.json
Best Practices
1. Test with Small Batches First
# Test with first 10 recipients
head -11 recipients.csv > test-batch.csv
ahasend messages send \
--from sender@example.com \
--recipients test-batch.csv \
--html-template template.html \
--sandbox
2. Use Idempotency Keys
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--idempotency-key "campaign-$(date +%Y%m%d)"
# Send with detailed logging
ahasend messages send \
--recipients users.csv \
--html-template template.html \
--verbose \
--show-metrics \
--output json
Troubleshooting
Slow Performance: Increase --max-concurrency up to 10 workers
High Failure Rate: Verify domains and check suppressions list
Memory Issues: Process large files in smaller chunks
Next Steps