Skip to main content
This guide shows how to send batches of personalized email with the AhaSend CLI and check the results. Before running the examples, log in with a full API key, use your verified sender domain, and replace YOUR_RESOURCE_ID with a resource UUID from your test account. Create any named template, recipient, attachment, or JSON files first. Shell examples use Bash; examples that read JSON with jq need jq installed. Sends use sandbox mode.

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

Recipient File Formats

Create recipients.csv:
CSV uses email for the address and name for the display name. Other columns become template variables. JSON uses email, optional name, and substitution_data for per-recipient variables. The CLI converts these into the API’s substitutions field. Save the template files named by a command before running it. Every send needs --from, --subject, a recipient source, and content.

Basic Batch Send

Performance Options

Concurrency Control

The default --max-concurrency is 1; the allowed range is 1–10. More workers do not change your account API limits. Throughput depends on request latency and your sending limits.

Progress Tracking

Error Handling

Automatic Retries

Failed Recipients Recovery

Failed recipients are saved as JSON at ~/.ahasend/failed-YYYYMMDD-HHMMSS.json. Replace the filename below with the actual file from a failed run:

Template Personalization

Global and Per-Recipient Data

global-data.json

Best Practices

1. Test with Small Batches First

2. Use Idempotency Keys

3. Monitor Performance

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