Adding Metadata
Include ametadata object in your send request. All values must be strings:
Metadata in Webhooks
When Lettr delivers a webhook event for an email that carries metadata, the full metadata object is included in the payload. This means your webhook handler can read the same keys you attached at send time and use them to look up the relevant order, customer, or transaction in your database without making additional API calls.Use Cases
Order Tracking
Link emails to orders for support and auditing.
User Attribution
Track which user triggered each email.
Analytics
Segment email performance by custom dimensions.
Debugging
Include request IDs for easier troubleshooting.
Metadata vs Tags
Lettr supports both metadata and tags on emails. They serve different purposes: metadata stores structured key-value data for detailed tracking, while a tag is a single string label for analytics grouping.| Feature | Metadata | Tag |
|---|---|---|
| Structure | Key-value pairs | Single string (max 64 chars) |
| Values | Strings only | Plain string |
| Where it appears | Webhooks, dashboard | Analytics dashboard filters and breakdowns |
| Best for | Detailed tracking data (order IDs, customer IDs) | Grouping emails for analytics (e.g., welcome-series) |
Example: Full Tracking Setup
Limits
| Limit | Value |
|---|---|
| Max keys | 50 |
| Max key length | 40 characters |
| Max value length | 500 characters |
| Max total size | 8 KB |