Template System
The AhaSend CLI uses Jinja2 templating for creating personalized emails.Template Basics
Use double curly braces for variable substitution:Substitution Types
Global Substitutions
Applied to all recipients - use for company-wide data:Recipient Substitutions
Per-recipient data from CSV/JSON files:- CSV Format
- JSON Format
Basic Examples
Simple Template
Conditional Content
Lists and Loops
Testing Templates
Test templates using sandbox mode:Best Practices
- Use meaningful variable names:
{{customer_first_name}}
not{{fn}}
- Provide default values:
{{name|default("Friend")}}
- Test with real data: Use sandbox mode before sending
- Keep templates simple: Complex logic belongs in your application
- Global vs recipient data: Company info in global, personal info per recipient