Header Usage: All AhaSend special headers are removed before email delivery and are never visible to recipients. They’re used only to control AhaSend’s processing behavior.
Available special headers
Tracking Control
Override open and click tracking settings for individual emails
Sandbox Testing
Control sandbox mode behavior and simulated outcomes
Data Retention
Customize data retention policies per email
Message Tagging
Add custom tags for organization and filtering
Idempotency Key
Retry a send without sending the same message twice
Tracking headers
Control email tracking behavior on a per-message basis, overriding your account-wide settings. Header names are case-insensitive. This page usesAhaSend- casing for readability.
Open tracking header
Header:ahasend-track-opensValues:
true | falsePurpose: Enable or disable open tracking for individual emails
Open Tracking Requirements: The sending domain’s tracking domain must be set up, or the message is sent without tracking. Only HTML emails are supported.
SMTP Example
Click tracking header
Header:ahasend-track-clicksValues:
true | falsePurpose: Enable or disable click tracking for individual emails
Click Tracking Requirements: The sending domain’s tracking domain must be set up, or the message is sent without tracking. Only HTML emails with
http:// and https:// links are supported.SMTP Example
Excluding individual links
To exclude specific links from click tracking while keeping it enabled for the email, add thedata-as-no-track attribute:
Sandbox headers
Control sandbox mode behavior for testing without affecting real email delivery.Sandbox mode header
Header:AhaSend-SandboxValues:
true | 1Purpose: Enable sandbox mode for individual emails, even with production credentials
SMTP Example
Sandbox result header
Header:AhaSend-Sandbox-ResultValues:
deliver | bounce | defer | fail | suppressPurpose: Control the simulated outcome for sandbox emails
Available Outcomes
Available Outcomes
deliver- Simulates successful delivery (default)bounce- Simulates a hard bouncedefer- Simulates temporary delivery deferralfail- Simulates permanent delivery failuresuppress- Simulates suppression list blocking
SMTP Example
Retention headers
Customize data retention policies for individual emails, overriding your account defaults.Message retention headers
AhaSend provides two types of retention control for different aspects of your email data:Message Metadata & Delivery Log Retention
Message Metadata & Delivery Log Retention
Header:
Values: 1 day to your plan’s maximum
Purpose: Control how long metadata and delivery logs are retainedIncludes delivery status, timestamps, recipient information, and tracking data.
ahasend-metadata-retentionValues: 1 day to your plan’s maximum
Purpose: Control how long metadata and delivery logs are retainedIncludes delivery status, timestamps, recipient information, and tracking data.
Message Data Retention
Message Data Retention
Header:
Values: Within your plan’s range; 0 needs approval
Purpose: Control how long the actual email content is retainedIncludes email body, attachments, and complete message content. Set to 0 for immediate deletion after processing.
ahasend-data-retentionValues: Within your plan’s range; 0 needs approval
Purpose: Control how long the actual email content is retainedIncludes email body, attachments, and complete message content. Set to 0 for immediate deletion after processing.
Retention examples
SMTP Example
Retention use cases
High Security
For emails containing sensitive data you can disable data retention to prevent it from being stored in our database:
ahasend-metadata-retention: 1-3 daysahasend-data-retention: 0 days
Message tags header
Add custom tags to emails for organization, filtering, and analytics. Header:ahasend-tagsFormat: Comma-separated list of tags
Limits:
- Maximum 10 tags per email
- Each tag maximum 64 characters
- Tags are case-sensitive
Tag usage examples
SMTP Example
Tag best practices
Naming Conventions
Naming Conventions
- Use lowercase with hyphens:
welcome-series,product-update - Be descriptive:
password-resetvsreset - Use consistent naming across campaigns
- Consider hierarchical tags:
email-type:welcome,campaign:q1-2024
Organization Strategies
Organization Strategies
- Campaign tracking:
campaign:black-friday,campaign:welcome-series - Email types:
transactional,marketing,notification - User segments:
premium-users,trial-users,enterprise - Content categories:
product-updates,security-alerts,newsletters
Idempotency key header
Retry an SMTP send safely when you do not know whether AhaSend accepted it. Header:ahasend-idempotency-keyValues: A key of 1 to 255 bytes, such as a UUID
Purpose: Send a message again without a second copy to the same recipient The header is optional. Make a new key for each message, and save it with the message in your application. If your client does not get the answer to a send, for example because the connection closed, send the same message again with the same key. If AhaSend accepted the first message, it accepts the second one and does not send it. A quick retry can first get a
451 answer; see Answers to a message with a key.
SMTP Example
How the key works
- Within 24 hours of the first message, a second message from the same account with the same key to the same recipient is accepted and not sent.
- AhaSend does not compare the content of the messages. Within those 24 hours, a message with the key of an accepted message to that recipient is not sent, also when its content is different. Each new message needs a new key.
- Each recipient of a message is checked on its own. When a message with a key names a recipient two times, that recipient gets one copy.
- A sandbox message uses up its key like any other message, so use different keys for sandbox and live sends.
- AhaSend removes the header before delivery.
- On a send through the API, this header has no effect, and AhaSend removes it. API v2 uses the
Idempotency-Keyheader of the request. See Idempotency.
Answers to a message with a key
The
250 answer gives an ID for each copy, also for a copy that AhaSend did not send. No stored message has the ID of a copy that was not sent.
Combining headers
You can use multiple special headers together for comprehensive email customization:SMTP Example
Header reference summary
Tracking Headers
Tracking Headers
ahasend-track-opens:true|false- Control open trackingahasend-track-clicks:true|false- Control click tracking- Use
data-as-no-trackattribute to exclude individual links from click tracking
Sandbox Headers
Sandbox Headers
AhaSend-Sandbox:true|1- Enable sandbox modeAhaSend-Sandbox-Result:deliver|bounce|defer|fail|suppress- Control simulated outcome
Data Management Headers
Data Management Headers
ahasend-metadata-retention: Integer within your plan’s range - metadata and delivery log retention in daysahasend-data-retention: Integer within your plan’s range - email content retention in days; 0 needs approvalahasend-tags: Comma-separated list - Message tags (max 10 tags, 64 chars each)
Retry Headers
Retry Headers
ahasend-idempotency-key: 1 to 255 bytes, a new key for each message - Within 24 hours, no second message from the same account with the same key to the same recipient
Important notes
Header Processing
🗸 All AhaSend headers are removed before delivery
🗸 Recipients never see these special headers
🗸 Headers only affect AhaSend’s processing behavior
🗸 Recipients never see these special headers
🗸 Headers only affect AhaSend’s processing behavior
Priority & Overrides
🗸 Per-email headers override account settings
🗸 Headers take effect immediately
🗸 Sandbox headers work with any credential type
🗸 Headers take effect immediately
🗸 Sandbox headers work with any credential type

