Skip to main content
Metadata lets you attach arbitrary key-value pairs to any email you send through Lettr. These pairs travel with the email through the entire delivery lifecycle — appearing in webhook payloads and the dashboard — so you can correlate emails with your application’s data model. Common uses include linking emails to orders, customers, support tickets, or internal request IDs for debugging.

Adding Metadata

Include a metadata 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.

Example: Full Tracking Setup

Limits

Don’t store sensitive information (passwords, API keys, PII) in metadata. Metadata is visible in the dashboard and webhook payloads.