Skip to main content

Custom Headers and Metadata

Mailofly allows you to specify custom RFC 2822 email headers and metadata for threading, tracking, and compliance.

Custom Headers

You can include any custom headers using the headers parameter:

Common Header Use Cases

  • In-Reply-To & References: Keep transactional emails grouped inside the same email conversation thread in Gmail and Outlook.
  • List-Unsubscribe & List-Unsubscribe-Post: Enables the native one-click “Unsubscribe” button at the top of Gmail and Apple Mail headers.
  • X-Custom-Tracking-ID: Pass custom internal IDs to correlate incoming webhook events back to your database.

Metadata & Tags

Instead of custom headers, you can pass structured JSON key-value pairs in the tags property:
These tags are stored with the message record and echoed back in all webhook events (email.delivered, email.clicked, email.bounced), making it simple to process analytics downstream.