default for missing values and test your rendering with sandbox mode; see API templates.
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.
Template Basics
Use double curly braces for variable substitution:Substitution Types
Global Substitutions
Applied to all recipients - use for company-wide data:company-data.json
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

