# Email Set up and manage email registration, compliance, and delivery for your Airship project. # Getting Started > Email is a native Airship messaging channel, supporting both commercial and transactional messages.## Overview Getting started with Airship email is a three-step process. This document will guide you through the following steps: * Provision your account for email. * Register users. * Optionally create content templates and send email. > **Tip:** If you use an AI coding assistant, you can connect it to Airship with Skills and an MCP server. See [Airship AI Tools](https://www.airship.com/docs/developer/ai-tools/ai-tools/). ## Provision Account To get started using Airship email, contact your account manager or [Airship Support](https://support.airship.com) to provision your project for email notifications. ## Register Users Registering an email address returns a [Channel ID](https://www.airship.com/docs/reference/glossary/#channel_id). You will typically reference your audience of email addresses by Channel IDs or other abstractions within Airship rather than using the email address directly. There are multiple ways to register users: * **Email address submission in a Scene** — A user can submit their address using the [Email element](https://www.airship.com/docs/guides/messaging/editors/native/elements/#email) in a [Scene](https://www.airship.com/docs/reference/glossary/#scene). The address is associated with the [Contact](https://www.airship.com/docs/reference/glossary/#contact) viewing the Scene, and the channel is automatically opted in to both transactional and commercial messaging. * **Opt-in form** — A user can sign up for email messages through an [opt-in form](https://www.airship.com/docs/guides/messaging/features/opt-in-forms/) you can add to your website. * **Email channel registration API** — You can generate an email channel for an individual user by using the [Email Channel Registration API](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#registeremailchannel). * **Simultaneously send a message and register new user** — See [Create and Send](https://www.airship.com/docs/reference/glossary/#create_and_send). * **SDK** — Register an email channel through the [Android](https://www.airship.com/docs/developer/sdk-integration/android/audience/contacts/#email-channel-association) and [Apple](https://www.airship.com/docs/developer/sdk-integration/apple/audience/contacts/#email-channel-association) SDKs. * **CSV Upload** — You can upload email addresses in a CSV file to set [Tags](https://www.airship.com/docs/reference/glossary/#tag) or [Attributes](https://www.airship.com/docs/reference/glossary/#attributes). Airship registers new channels for addresses that are new to your project. See: * [Setting attributes using a CSV file](https://www.airship.com/docs/guides/audience/attributes/setting/#csv-file) * [Setting tags using a CSV file](https://www.airship.com/docs/guides/audience/tags/#file-upload) **Example Request — Registration** ```http POST /api/channels/email HTTP/1.1 Authorization: Basic Accept: application/vnd.urbanairship+json; version=3 Content-Type: application/json { "channel": { "type": "email", "commercial_opted_in": "2018-07-30T08:35:00", "address": "name@example.com", "timezone": "America/Los_Angeles", "locale_country": "US", "locale_language": "en" } } ``` **Example Response — Registration** ```http HTTP/1.1 201 Created Content-Type: application/vnd.urbanairship+json; version=3 { "ok": true, "channel_id": "adb2f0ca-e2a4-4c16-bda5-37736EXAMPLE" } ``` We recommended also associating the email channel with a [Named User](https://www.airship.com/docs/reference/glossary/#named_user): **Example Request — User Association** ```http POST /api/named_users/associate HTTP/1.1 Authorization: Basic Accept: application/vnd.urbanairship+json; version=3 Content-Type: application/json { "channel_id": "adb2f0ca-e2a4-4c16-bda5-37736EXAMPLE", "device_type": "email", "named_user_id": "example-named-user-id" } ``` ### Opt-in/out Values You can account for the types of emails each address has subscribed to, or unsubscribed from, for both commercial and transactional messages. We represent subscription, as well as tracking permissions, using `opted_in` and `opted_out` values on email. * `commercial_opted_in`: The date-time that a user subscribed to commercial emails. * `commercial_opted_out`: The date-time that a user unsubscribed from commercial emails. * `transactional_opted_in`: The date-time that a user subscribed to transactional emails from you. Users do not have to subscribe to transactional emails; you only need to use this key if a user opted into transactional emails after previously opting out. * `transactional_opted_out`: The date-time that a user unsubscribed from transactional emails. * `open_tracking_opted_in`: The date-time that a user enabled open tracking of emails. New channels are opted in by default. * `open_tracking_opted_out`: The date-time that a user disabled open tracking of emails. * `click_tracking_opted_in`: The date-time that a user enabled click tracking in emails. New channels are opted in by default. * `click_tracking_opted_out`: The date-time that a user disabled click tracking in emails. > **Note:** For [Create and Send](https://www.airship.com/docs/reference/glossary/#create_and_send) endpoints, you can provide one of `ua_commercial_opted_in` > or `ua_transactional_opted_in`, corresponding to the type of email you want to send. These keys are all optional. However, an email channel with no `opted_in` or `opted_out` values can only receive transactional emails. Users must have a `commercial_opted_in` value to receive commercial emails; users do not need to subscribe to receive transactional emails (though they can explicitly unsubscribe). If a user has an `opted_out` of a particular email type (or the user never opted into commercial emails), and the user is a part of your audience for a message of that type, the email designated for the opted-out user is dropped at delivery time. If a channel has both `opted_in` and `opted_out` values for a particular email type, Airship respects the most recent value. So, if a user opted into commercial emails after previously opting out, that user can receive commercial emails from you even though that user's channel possesses both `commercial_opted_in` and `commercial_opted_out` values; if the opt-in date is prior to the opt-out date, the user will not receive commercial emails from you. ### Double Opt-In *Double opt-in* is a process where users who sign up for messaging must confirm opting in before they can receive messages. You can use double opt-in to ensure your email subscribers intended to sign up and have entered the correct email address. The general process: 1. A new user signs up for email messaging. — *You can add an* [Opt-in Form](https://www.airship.com/docs/reference/glossary/#opt_in_form) *to your website.* 1. Airship sends a confirmation email to the address used to sign up. — *You set up the email in the dashboard or using the API.* 1. The user follows the confirmation link in the email, and Airship updates their channel as opted in. 1. The user can now receive commercial emails. --- To set up the confirmation email: * From the dashboard, [create an Automation](https://www.airship.com/docs/guides/messaging/messages/sequences/create-automation/) or [Sequence](https://www.airship.com/docs/guides/messaging/messages/sequences/create/create/) using the [[Double Opt-In Trigger](https://www.airship.com/docs/reference/glossary/#double_opt_in_event_trigger)](https://www.airship.com/docs/guides/messaging/messages/sequences/triggers/#double-opt-in). * For the API, create an Automation use the `/api/pipelines` endpoint with the `double_opt_in` event. Sequences cannot be created using the API. You can filter the trigger by using properties attached to the opt-in event, and you can reference the properties using [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars) to personalize the message content. If you choose to use properties in these ways, **your developer must add the properties when setting up email channel registration**. You must provide an opt-in link in the body of the message, and users must follow the link to confirm opting in. For link formatting, see: [Email double opt-in links](https://www.airship.com/docs/guides/messaging/messages/content/email/email-double-opt-in-links/). Additionally, you must send the message as *Transactional* and should also bypass a user's opt-in status. (Though the confirmation email is transactional, its purpose is to subscribe to commercial messaging.) * In the dashboard, you set these options in *Sender Information* section when adding the message content. See [Creating content](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#creating-content) in *Email content*. * For the API, set `"message_type": "transactional"` and `"bypass_opt_in_level": "true"`. See: [Email Overrides](https://www.airship.com/docs/developer/rest-api/ua/schemas/platform-overrides/#emailoverrideobject). --- Next, set [`"opt_in_mode": "double"`](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#registeremailchannel) when registering new email channels. When a new channel is registered using this `"double"` parameter, it creates a `double_opt_in` event. This event is used to trigger sending the confirmation email. You can use the `properties` object to add properties for the event that be can used to filter the Automation or Sequence trigger and for personalizing the message content using [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars). ### Updating Registration You can update the `opted_in` and `opted_out` values using a PUT call for the channel. > **Important:** The `address` you provide in this request must be the one that is associated with the channel you > are updating. You may not update the user's email address with this endpoint. **Example Request — Update opt-in date** ```http PUT /api/channels/email/adb2f0ca-e2a4-4c16-bda5-37736EXAMPLE HTTP/1.1 Authorization: Basic Accept: application/vnd.urbanairship+json; version=3 Content-Type: application/json { "channel" : { "type": "email", "address": "name@example.com", "commercial_opted_in": "2021-11-01T12:00:25" } } ``` To comply with storage requirements for personally identifiable information, email addresses are not returned when you look up a channel. If you need to find the channel associated with an address, you can look up the channel by email address using the [`/api/channels/email/{email_address}` endpoint](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#getemailchannel). **Example Request — Lookup channel by email address** ```http GET /api/channels/email/name%40example.com HTTP/1.1 Authorization: Basic Accept: application/vnd.urbanairship+json; version=3 Content-Type: application/json ``` ### Updating an Email Address You may register a new email address and remove an existing address using the [Replace Email Channel endpoint](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#replaceemailchannel). Performing this operation will: * Register a new email channel * Associate the new email channel with the same user as the source channel * Uninstall the source channel In the following example, `c59e2660-8a5f-4b11-9439-c4e0fEXAMPLE` is Channel ID of the channel you're replacing: **Example Request — Replace** ```http POST /api/channels/email/replace/c59e2660-8a5f-4b11-9439-c4e0fEXAMPLE HTTP/1.1 Authorization: Basic Accept: application/vnd.urbanairship+json; version=3 Content-Type: application/json { "channel": { "type": "email", "commercial_opted_in": "2022-04-07T18:51:00", "address": "new-name@example.com", "timezone": "America/Los_Angeles", "locale_country": "US", "locale_language": "en" } } ``` **Example Response — Replace** ```http HTTP/1.1 201 Created Content-Type: application/vnd.urbanairship+json; version=3 { "ok": true, "channel_id": "a7808f6b-5cd8-458b-88d0-96eceEXAMPLE" } ``` > **Important:** When replacing an email address for a user, a new email channel is created. This > channel inherits the properties of the contact to which it's associated, but > does not inherit any properties from the source channel. > > We recommend associating email addresses with a [Named User](https://www.airship.com/docs/reference/glossary/#named_user), and performing actions such as setting tags or attributes, or > attributing events, at the user level. ### Unsubscribe When a user unsubscribes to email of a particular type, you should set the `commercial_opted_out`, `transactional_opted_out`, or both to the date-time when the user unsubscribed. While the `opted_in` values are still present on the unsubscribed email channel, Airship will respect the newer `opted_out` values; the channel will not receive emails corresponding to the `opted_out` type, even if they are members of the audience for an email. As a more drastic measure, you can also [uninstall email channels entirely](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#uninstallemailchannel). You should use this option with caution. If the uninstalled email address opts-in again, it will generate a new `channel_id`. You cannot reassociate the new `channel_id` with any opt-in information, tags, Named Users, insight reports, or other information from the uninstalled email channel. ### Suppression When Airship receives feedback for a delivery address, such as a hard bounce or a spam complaint, their email channel's `suppression_state` value is automatically updated according the type of complaint received. Possible values: `spam_complaint`, `commercial_spam_complaint`, `bounce`, or `imported`. You can also set a value when registering users. For more information, including about about removing suppression, see: [Email Bounce Handling and Suppression](https://www.airship.com/docs/developer/api-integrations/email/bounce-handling/). ## Send Email Now that you have registered users, they are able to receive email from Airship. Email messages can be sent via the Airship dashboard or API. * **Dashboard** — See [Email content](https://www.airship.com/docs/guides/messaging/messages/content/email/email/) to learn how to configure the email content in a [message](https://www.airship.com/docs/guides/messaging/messages/create/), [A/B test](https://www.airship.com/docs/guides/experimentation/a-b-tests/messages/), [Automation](https://www.airship.com/docs/guides/messaging/messages/sequences/create-automation/), or [Sequence](https://www.airship.com/docs/reference/glossary/#sequence). * **API** — Use the [Push API](https://www.airship.com/docs/developer/rest-api/ua/operations/push/); you must set [email platform overrides](https://www.airship.com/docs/developer/rest-api/ua/schemas/platform-overrides/#emailoverrideobject) such as `sender_name`, `sender_address`, etc. You can also create templates for your email notifications. You [create templates in the dashboard](https://www.airship.com/docs/guides/personalization/content/templates/), then send using the dashboard or API. In the API, send a template using the [`/create-and-send`](https://www.airship.com/docs/developer/rest-api/ua/operations/bulk-sending/#createandsend) or [`/pipelines`](https://www.airship.com/docs/developer/rest-api/ua/operations/automation/) APIs. > **Important:** * You can provide your own HTML email without using a template. However, you cannot personalize emails using merge fields without using a template. > > * If your template contains merge fields, you must include all merge fields in your request or none at all. # Commercial vs. Transactional Email > The Airship platform handles commercial email legal requirements and industry best practices, from opt-in/opt-out rules to data privacy laws.An email can contain three different types of information: * **Commercial content** — Advertises or promotes a commercial product or service, including content on a website operated for a commercial purpose. * **Transactional (or *relationship*) content** — Facilitates an already agreed-upon transaction, or updates a customer about an ongoing transaction. * **Mixed content** — Both commercial and transactional content in the same message. > **Note:** Emails are considered **commercial by default and require an unsubscribe link**. You can manually flag messages as transactional and send them without the unsubscribe link, in accordance with CAN-SPAM regulations. ## Commercial Content If the message contains only commercial content, its primary purpose is commercial, and it must comply with the requirements of [CAN-SPAM](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/can-spam-rule). If it contains only transactional or relationship content, its primary purpose is transactional or relationship. In that case, it may not contain false or misleading routing information, but is otherwise exempt from most provisions of the CAN-SPAM Act. ## Transactional Content The primary purpose of an email is transactional or relationship if it consists only of content that: 1. Facilitates or confirms a commercial transaction that the recipient already has agreed to; 1. Gives warranty, recall, safety, or security information about a product or service; 1. Gives information about a change in terms or features or account balance information regarding a membership, subscription, account, loan, or other ongoing commercial relationship; 1. Provides information about an employment relationship or employee benefits; or 1. Delivers goods or services as part of a transaction that the recipient already has agreed to. ## Mixed Content It's common for email sent by businesses to mix commercial content and transactional or relationship content. When an email contains both kinds of content, the primary purpose of the message is the deciding factor. Here's how to make that determination: > If a recipient reasonably interpreting the subject line would likely conclude that the message contains an advertisement or promotion for a commercial product or service, or if the message's transactional or relationship content does not appear mainly at the beginning of the message, the primary purpose of the message is commercial. So, when a message contains both kinds of content – commercial and transactional or relationship – if the subject line would lead the recipient to think it's a commercial message, it's a commercial message for CAN-SPAM purposes. Similarly, if the bulk of the transactional or relationship part of the message doesn't appear at the beginning, it's a commercial message under the CAN-SPAM Act. For more information, see the FTC's [CAN-SPAM Act: A Compliance Guide for Business](https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business). ## Opt-in and Opt-out Requirements {#opt-in-reqs} **Commercial Emails** * Require date of consent to subscribe (register) an email address to the commercial email list. * Require an [unsubscribe link](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/) in the email content. You can also provide separate unsubscribe links to opt out of [Subscription Lists](https://www.airship.com/docs/reference/glossary/#subscription_list). * Customers who unsubscribe from commercial emails will still be registered to receive transactional emails (unless they unsubscribe from a transactional email as well). **Transactional Emails** * Date of consent to register an email address to receive transactional emails is optional. If no consent date is included and the user has opted out of transactional type emails from your brand, then they will not be able to receive any in the future. If they need to be re-registered to receive these emails, then their date of consent is required and must be later than their opt out date. * Unsubscribe links are not required for transactional email messages, and in most cases we do not recommend including one. **Business-critical Emails** * There are some cases where a brand would like to include an unsubscribe link on a type of transactional email but will still need to send business-critical emails, such as order confirmations or password reset emails. In these cases, the opt-out can be overridden and sent regardless of unsubscribe status (for commercial or transactional). * Business-critical emails should never include an unsubscribe link. **Bounce Handling** See: [Bounce Handling](https://www.airship.com/docs/developer/api-integrations/email/bounce-handling/). **Spam Complaints** * Some end users will not want to receive any emails from your brand at all, and will show this by hitting the Spam button in their inbox. When this occurs, Airship will remove the email address from your list, mark the email channel as a spam complaint, and never deliver to it again. **Change of Address** * If a customer has changed their email address in a brand's system, you can update the Airship record using the API. This will update the email address while maintaining the channel ID, named user, and any tag information added for that channel. See: [Updating Addresses and Registration](https://www.airship.com/docs/developer/api-integrations/email/getting-started/#updating-addresses-and-registration). **Compliance Event API** * Maintaining clean mailing lists is important — not only for Airship, but for your brand as well. You can use the free [Compliance Event API](https://www.airship.com/docs/developer/rest-api/connect/operations/compliance-event-stream/#opencomplianceeventstream) to stream send, unsubscribe, bounce, and spam complaint events. These events should be processed and properly handled on your end on a regular basis. # Analytics and Reporting > Airship captures events from last-mile delivery services, so you can track both email statuses and engagement.## Last-mile Events Last-mile delivery events appear in [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds) and message reports as [Custom Email Events](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-email-events/). Status events, like `bounce` and `delay`, help you determine whether or not your messages are received by your audience. We also capture `open`, `click`, and `delivery` events so you can track engagement metrics for your email campaigns. For `click`, only HTTP and HTTPS links are tracked. See [Custom Email Events](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-email-events/) for a complete list of last-mile events and their properties. ## Custom Events To add your own custom events to a channel or named user, use the [Custom Events API](https://www.airship.com/docs/developer/rest-api/ua/operations/custom-events/). ## Disable Events When creating your message, you can disable open and click tracking to preserve your audience's privacy and exclude irrelevant messages from your metrics. You may want to disable open and click tracking for things like transactional messages or messages where you don't have a clear call to action. See [Creating content](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#creating-content) in *Email content*. ## Performance Analytics Additional reporting is available in [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa). See: [Email in Performance Analytics](https://www.airship.com/docs/guides/reports/analytics/email/). # Email Bounce Handling and Suppression > Airship handles issues with email delivery automatically to protect your sending reputation and help ensure compliance.## Email bounce events When an email fails to deliver to a recipient's inbox, Airship will report that failure via the [Compliance Stream](https://www.airship.com/docs/guides/reports/real-time-data-streaming/#compliance-events-for-email-and-sms) and internal reporting. Emails can bounce for a variety of reasons, which Airship will consider either a "soft" or "hard" bounce. Airship distinguishes between hard and soft bounces with a `bounce_class`. Hard bounces are represented in events with `bounce_class` values of 10, 30, or 90. When a hard bounce response is received, an email address is considered to be permanently undeliverable. All other classes of bounce are considered soft bounces and delivery will continue to be attempted for future messages. In order to protect your sending reputation, email addresses that receive a hard bounce will be "suppressed" from future messaging. ## Email suppression Suppression acts as a failsafe to prevent accidental sends to addresses that may pose a risk to either sending reputation or to legal compliance. Airship tracks a suppression state per channel, in addition to transactional and commercial opt-in status. To be eligible to receive email messages, an address must be both opted-in and not suppressed for the type of messaging being sent. For example, when a recipient marks a message as spam, a suppression state of `spam_complaint` is added to the channel. While suppressed, the email address will not receive any messaging, regardless of their opt-in state. If an audience list is later uploaded that updates the opt-in status of the email address, Airship will continue to honor the suppression state and will continue to not send any messages to the address. ### Suppression types An email channel can have one of four suppression state values. Depending on the value, the suppression state can function as either a full or partial block. * `bounce` — A hard bounce response was received. The address is considered undeliverable, and continuing to send to it could hurt the sender's reputation. **No future messages will be sent to the email address**. * `spam_complaint` — A recipient marked a [Transactional Email](https://www.airship.com/docs/reference/glossary/#transactional_email) as spam. This indicates they do not wish to receive any additional messages from the brand, regardless of type. **No future messages will be sent to the email address**. * `commercial_spam_complaint` — A recipient reported a message designated as [Commercial Email](https://www.airship.com/docs/reference/glossary/#commercial_email) as spam. They have indicated that they do not want to receive future communications of that type. **Transactional email will continue to be sent, but no future commercial email will be sent**. * `imported` — This value may be set manually via API or list upload to suppress a channel. **No future messages will be sent to the email address**. ### Looking up suppression state * **API** — Use the API to download a list of all email channels with their suppression state included. * [Channel Lookup](https://www.airship.com/docs/developer/rest-api/ua/operations/channels/#getchannel) * [Look Up an Email Address](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#getemailchannel) * **Dashboard** — If you know the email address, named user, or channel ID that you are looking for, you can view the suppression state for an individual channel in [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/#viewing-channel-details). ### Setting suppression Set suppression status for an individual email channel using the [Suppress an Email Channel API](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#suppressemailchannel). ### Removing suppression > **Important:** * Suppression is an added layer of protection that opts out an email channel from messaging, preventing sending email to the address. Please consult your legal counsel to determine if your specific use case aligns with regulatory requirements in your jurisdiction. > > * After removing suppression, you must opt the channel back in to messaging before they can receive email from you again. For the API, use the [Remove Suppression from an Email Channel API](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#unsuppressemailchannel) to remove the suppression reason. For the dashboard, see [Removing email suppression](https://www.airship.com/docs/guides/audience/contact-management/#removing-email-suppression) in *Contact Management*. ## Bounce class reference The `bounce` compliance event type reflects the reason that an email server or recipient rejected your email as a `bounce_class`. The `bounce_class` is a reason code between 1 and 100. > **Note:** Hard `bounce_class` events (classifications 10, 30, and 90) result in an automatic opt-out for the `delivery_address` listed in the event. |Classification|Name|Description|Category| |--- |--- |--- |--- | |1|Undetermined|The response text could not be identified.|Undetermined| |10|Invalid Recipient|The recipient is invalid.|Hard| |20|Soft Bounce|The message soft bounced.|Soft| |21|DNS Failure|The message bounced due to a DNS failure.|Soft| |22|Mailbox Full|The message bounced due to the remote mailbox being over quota.|Soft| |23|Too Large|The message bounced because it was too large for the recipient.|Soft| |24|Timeout|The message timed out.|Soft| |25|Admin Failure|The message was failed by SparkPost’s configured policies.|Admin| |26|Smart Send Suppression|The message was suppressed by Smart Send policy.|Admin| |30|Generic Bounce: No RCPT|No recipient could be determined for the message.|Hard| |40|Generic Bounce|The message failed for unspecified reasons.|Soft| |50|Mail Block|The message was blocked by the receiver.|Block| |51|Spam Block|The message was blocked by the receiver as coming from a known spam source.|Block| |52|Spam Content|The message was blocked by the receiver as spam.|Block| |53|Prohibited Attachment|The message was blocked by the receiver because it contained an attachment.|Block| |54|Relaying Denied|The message was blocked by the receiver because relaying is not allowed.|Block| |60|Auto-Reply|The message is an auto-reply/vacation mail.|Soft| |70|Transient Failure|Message transmission has been temporarily delayed.|Soft| |80|Subscribe|The message is a subscribe request.|Admin| |90|Unsubscribe|The message is an unsubscribe request.|Hard| |100|Challenge-Response|The message is a challenge-response probe.|Soft| # Email Custom Unsubscribe Pages > Unsubscribe links are a critical component of your email program. You can take advantage of Airship's default unsubscribe link behavior or use a custom unsubscribe flow.> **Important:** If you use a custom unsubscribe page, it is your responsibility to ensure that email unsubscribe requests are handled in accordance with CAN-SPAM and other regulatory requirements that may apply to your local jurisdiction. By default, email is for [commercial use](https://www.airship.com/docs/developer/api-integrations/email/commercial-transactional/) and requires an unsubscribe link in both the HTML and plain text message bodies. ## Default unsubscribe handling When the user follows an unsubscribe link, Airship unsubscribes the user (i.e., opts them out of email messaging) and redirects to a confirmation web page that tells them they are unsubscribed. The Airship-hosted default confirmation web page displays the message "You have been successfully unsubscribed." You also have the option to link to your own confirmation web page. The user is opted out of all commercial messages if the message was marked as commercial or opted out of all email messaging if marked as transactional. ## How custom unsubscribe pages work Custom unsubscribe pages are a double opt-out flow where users are not immediately unsubscribed when they click the unsubscribe link in an email. Instead, they are redirected to your custom web page, which must contact Airship systems to unsubscribe the user from future messaging. When using custom unsubscribe pages, you will add a link to your custom web page in the email body using specific formatting. Airship will route users to your page, appending some extra identifiers to your URL that your page can use to fetch or update user data in Airship systems. The method of unsubscribing is fully in your control. It can be as simple as a link to confirmation page, or you can employ the flexibility of the Airship API. For example, you can have a confirmation button that unsubscribes the user from all emails, or you can allow users to choose specific topics that they want to opt out of. ### Unsubscribe web page You must self-host your unsubscribe web page. It can be a static HTML page with a link to confirm unsubscribing. This does not require a backend. The drawback of this method is that the user is unsubscribed from all emails. With a more advanced implementation, you can make API calls from the unsubscribe page. This gives you the flexibility to do things like: * Display a "success" message directly on the unsubscribe page, eliminating the need for a confirmation page * Add or remove tags * Unsubscribe from a [Subscription List](https://www.airship.com/docs/reference/glossary/#subscription_list) This method can be useful if you host your own email unsubscribe page rather than using an Airship [Preference Center](https://www.airship.com/docs/reference/glossary/#preference_center). ### Unsubscribe links The unsubscribe links in your email messages must include an `href` attribute that points to your unsubscribe web page. The `href` is required when using custom unsubscribe pages. For formatting information, see: [Email unsubscribe links](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/). When an email body contains a link to a custom unsubscribe page, you do not need to also include an unsubscribe link for opting out of all messaging. ### Opt-out management Since the unsubscribe action is bypassed by Airship, you must manage user opt-out status yourself. You can do so via the Custom Unsubscribe URL or the Airship API. Both methods are described below in *Implementing custom unsubscribe pages*. ## Requesting enablement You must implement and test custom unsubscribe pages for a non-production project before going live in production. First, [ask Airship support](https://support.airship.com/) to enable custom unsubscribe pages for a test project. Make sure to include the project name and app key in your request. You can find both in the Airship dashboard: Next to your project name, select the dropdown menu (▼), then **Project Details**. When custom unsubscribe pages are enabled, Airship adds extra parameters (detailed below) to your project's unsubscribe links that are necessary for implementation. ## Creating your unsubscribe web page After a user clicks the unsubscribe link in your email, they go to your unsubscribe web page. You must add an unsubscribe action to the page, one of: 1. **Link to confirmation page** — The user clicks an "Unsubscribe from all" link on the page, which directs to a web page that tells them they are unsubscribed. 1. **API call from your unsubscribe page's backend** — This is useful for advanced unsubscribe options, such as creating a form that allows the user to choose their subscription preferences. The user experience is up to the developer. These options are not mutually exclusive, and you are free to implement both of them on your unsubscribe page. ### Linking to a confirmation page This unsubscribe method links from your unsubscribe page to a confirmation page. You format the link using the Custom Unsubscribe URL. The Custom Unsubscribe URL is integrated with Airship reporting and associates the unsubscribe action with the email message that brought the user to your unsubscribe page. After the link is clicked, you will be able to see the unsubscribe action in your message- and campaign-level reports. The Custom Unsubscribe URL you use depends on your data center location: * US: `https://asemailmgmtus.com/api/channels/email/custom-unsubscribe/` * EU: `https://asemailmgmteu.com/api/channels/email/custom-unsubscribe/` The URL **requires** the `ua_unsubscribe_token` query parameter in order to identify the user to unsubscribe and the originating message. You can access this query parameter on your unsubscribe page and pass it on to Airship's Custom Unsubscribe URL without changes. You can also use the `ua_redirect` query parameter to specify a custom confirmation page. For more information about the Custom Unsubscribe endpoint, see the [API: Custom Unsubscribe Email Channel](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#customunsubscribeemailchannel). This is an example of a basic unsubscribe web page with a link that unsubscribes the user and redirects them to a confirmation page: **Web page with an unsubscribe link** ```html Custom unsubscribe page Unsubscribe ``` ### Calling the Airship API This method is to make calls to the Airship API from your unsubscribe page's backend. In order to use the API to unsubscribe your email recipient, you need to be able to identify them. You can use handlebars to include the channel ID of the recipient in your unsubscribe URL by appending a query string parameter, for example: `channel_id={{$channel.id}}`. You can use this ID to look up the channel's email address, update the opt-in status of the channel, set tags or subscription lists, and more. For more information on available API operations, see the [Airship API Reference](https://www.airship.com/docs/developer/rest-api/ua/). Opting a user out via the API does not associate the opt-out with a message, and the opt-out is not included in message- or campaign-level reporting. ## Sending test messages and confirming opt-outs Once your custom unsubscribe page is published, create a test email message in Airship and use your unsubscribe web page URL in the unsubscribe link. For details about formatting unsubscribe links, see: [Email unsubscribe links](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/). To make sure that your unsubscribe page is successfully opting out users in Airship, use [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/) to view the current status of your test channels. ## Going live Once you've verified that your unsubscribe link is successfully working, [ask Airship support](https://support.airship.com/) to enable custom unsubscribe pages for your production project. Make sure to include the project name and app key in your request. You can find both in the Airship dashboard: Next to your project name, select the dropdown menu (▼), then **Project Details**. # Apple Private Email Relay > If you use the [*Sign in with Apple* login service](https://developer.apple.com/sign-in-with-apple/) in your app, your users can choose to route emails from you through Apple's private email relay service.[Apple's private email relay service](https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/communicating_using_the_private_email_relay_service) lets your users hide their email addresses as an added layer of privacy when using your app. When a user enables [Hide My Email](https://support.apple.com/en-us/HT210425), Apple generates a unique and randomized email address, e.g., `a1b2c3@privaterelay.appleid.com`, that you can associate with that user. When you send email to that address, Apple forwards it to the email address associated with the customer's Apple ID. ## Registering your domains with Apple In order to send Airship email messages to those using Apple private email relay, you must first register your domains with Apple. This ensures that if there’s a problem causing emails to fail, or the user no longer wants to receive your emails, Apple can notify you of the bounce. Follow the steps for *Register domains* in Apple's developer guide [Configure private email relay service](https://developer.apple.com/help/account/configure-app-capabilities/configure-private-email-relay-service/). If you are using a separate bounce domain from your sending domain, you'll need to register both the sending and the bounce domains. If you don’t register all the source domains, email sent to the private relay service will result in a bounce. > **Important:** * Before registering your domains, your Airship project must already be provisioned for email. Contact your account manager or [Airship Support](https://support.airship.com) if your project does not yet include email. > > * If you attempt to send emails to private relay email addresses but haven't registered your domains with Apple, your messages will be rejected. # Data Collection > Understand what data is collected for email channels.## Email event data collection Through our integration with our email service provider partner, Airship captures email event data to measure campaign performance, track engagement, take action on spam complaints, and to handle unsubscribe requests and other email bounce events. This information is used to populate reports, including [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa). It is also made available for processing outside of Airship via [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds). The following is a list of email events that we capture: | Event name | Description | | --- | --- | | injection | Message is received by or injected into our email service provider partner | | delivery | Remote Message Transfer Agent or Mailbox acknowledged receipt of a message | | bounce | Remote Message Transfer Agent or Mailbox has permanently rejected a message | | spam_complaint | Message was reported as spam by the recipient | | out_of_band | Remote Message Transfer Agent or Mailbox initially reported acceptance of a message, but it has since reported that the message was not delivered | | delay | Remote Mailbox has temporarily rejected a message | | click | Recipient clicked a tracked link in a message | | open | Recipient opened a message in a mail client, rendering a tracking pixel at the bottom of the message | | initial_open | Recipient opened a message in a mail client, rendering a tracking pixel at the top of the message | | list_unsubscribe | Recipient clicked the 'unsubscribe' button on their email client | | link_unsubscribe | Recipient clicked an unsubscribe link in a received email | To provide the services, Airship uses an email provider Subprocessor. The Subprocessor may also process the following data: * Email cloud sending data * Email address and contact data: name, email address, and other demographic and segment data provided by you as the customer * Email sending information: IP addresses, usage data, cookies data, location data, browser data * Email content * Event data as described in this document The data is used by the Subprocessor to provide the services, including event insights of emails sent to customers, provide support and troubleshooting, and to fulfill its legal obligations. ### Recipient details per event The following is a list of recipient data that we capture for [email events that we capture](#email-event-data-collection): | Recipient data | Description | Applicable Events | | --- | --- | --- | | Channel ID | Email channel identifier | *All events* | | Email Address | Email address of the end-user | *All events* | | Event Name | Type of engagement event | *All events* | | User Agent | User agent string returned for email client or web browser | open, initial_open, click | | Is Mobile | Indicates if this was a mobile device | open, initial_open, click | | Is Prefetched | Indicates if this event was likely prefetched, for example through Apple MPP | open, initial_open, click | | Is Proxy | Indicates if the user agent is a proxy server | open, initial_open, click | | Agent Family | Agent or client type based on user agent | open, initial_open, click | | Device Brand | Device Manufacturer based on user agent | open, initial_open, click | | Device Family | Device Model based on user agent | open, initial_open, click | | OS Family | Operating system based on user agent | open, initial_open, click | | OS Version | Operating system version based on user agent | open, initial_open, click | Tracking for `click`, `open`, and `initial_open` is enabled by default. You can disable open and click tracking per channel in [Contact Management](https://www.airship.com/docs/guides/audience/contact-management/#viewing-channel-details). You can disable open and click tracking per message when [configuring Sender Information](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#creating-content). ## Email pixel tracking Email opens are measured using a transparent pixel image embedded in the message HTML. When an email client loads the image, the request is recorded as an open event. This helps gather data that indicates the email's effectiveness, aiding in marketing strategy and optimization of future campaigns. * `initial_open` is triggered by a pixel positioned near the top of the message. * `open` is triggered by a pixel positioned near the bottom of the message. Email marketers depend on being able to measure campaign success and audience engagement through pixel tracking. Changes in email client behavior, particularly within Gmail and Apple Mail, now influence the accuracy of these metrics. ### Prefetching Tracking pixel prefetching occurs when an email client, or intermediary proxy, requests remote images, including the tracking pixel, before or without a human viewing the message. These automated requests can register as opens and inflate open and unique open counts. In addition, device and location attribution may reflect proxy infrastructure rather than the end device. ### Gmail prefetching and Apple MPP When a user of Google's Gmail receives an email during their session, whether on web or mobile app, Gmail triggers prefetching in order to download all email images just before display. The prefetch request originates from a Google IP address and includes a specific user-agent string, which Airship uses to distinguish prefetch opens from genuine opens. An example of this user-agent string is `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246 Mozilla/5.0`. With the release of Apple iOS 15, iPadOS 15, watchOS 8 and macOS 12 Monterey, Apple began offering Mail Privacy Protection (MPP), which hides the recipient's email address from senders. This prevents the sender from being able to identify the recipient or use pixel tracking. Also, open timestamps from MPP do not represent the actual time a recipient viewed the message. Similar to Gmail, Apple's proxy servers employ specific user-agent strings. Most Apple Mail users enable MPP. The inability to discern genuine opens from Apple's prefetch opens renders open statistics originating from Apple devices unreliable, so monitoring user-agent strings is important for understanding email opens' origins. ### Interpreting prefetched opens Prefetching makes it hard to know whether an open is from a real user or an automated client. Simply filtering by user agent isn't reliable since client behavior varies, and excluding prefetched traffic entirely can distort engagement metrics. Airship addresses this challenge by combining multiple engagement signals rather than relying solely on open events. Our reporting emphasizes stronger engagement indicators, such as link clicks enriched with URL parameters, to provide a clearer view of genuine user behavior. Airship separates prefetched opens from genuine opens, giving you flexibility in how you analyze your email performance. **In reporting:** - Message reports count prefetched and unknown opens separately from genuine opens. With the Click Map, you can learn how to position key elements where they are most likely to be seen and engage users. See [Email Performance](https://www.airship.com/docs/guides/reports/message/#email-performance) in *Message Reports*. - [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa) lets you access separate Total and Unique opens using the `IsPrefetched` dimension. See [Email in Performance Analytics](https://www.airship.com/docs/guides/reports/analytics/email/) to explore this data. **Best practices for analysis:** - Segment or exclude events flagged as `Is Prefetched` when analyzing performance. - Prioritize `click` events and downstream conversion metrics over opens for KPI tracking. - Use the separated data to understand the impact of prefetching on your specific audience. ## Data privacy Airship makes HTTPS encryption (also referred to as TLS connection) available for data in transit to or from the Service. For more information, see [Airship Security Measures](https://www.airship.com/legal/security-measures/). Email data collected by Airship is not transferred to any third parties unless a partner integration is enabled and configured by the application. For information on individual data requests, see [Individual Data Privacy Rights](https://www.airship.com/docs/guides/audience/privacy/individual-data-privacy/). # Email Compliance > Airship supports email best practices.> **Important:** Please note that this content is provided for information purposes only and is not intended to be nor should be relied on as legal or compliance advice. > > Different locations may have varying legal and privacy requirements for email notifications, so please verify with your legal or regulatory compliance team that your email usage, proposed use cases, and messaging configuration are compliant with applicable local laws and regulations. Airship's email service provides customers with a platform for building successful marketing programs while supporting compliance with applicable laws and regulations such as [CAN-SPAM](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/can-spam-rule), [General Data Protection Regulation (GDPR)](https://gdpr-info.eu/), and the Directive on Privacy and Electronic Communications (the EU's ePrivacy Directive). See also [Data Collection for Email](https://www.airship.com/docs/developer/api-integrations/email/data-collection/). ## General requirements You must obtain consent, provide disclosure, and designate email type. ### Commercial and transactional email Email messages generally fall into two categories: - **Commercial** — This is primarily promotional content intended to market products or services. - Most jurisdictions require prior consent before sending. - Recipients must be able to easily unsubscribe. - **Transactional** — This is content necessary to facilitate or complete a transaction, such as receipts, order confirmations, and account alerts. - Transactional email may not require consent, but must stay within the scope of the transaction. When composing a message in Airship, designate the type of email. This ensures that unsubscribe handling, suppression logic, and analytics are applied appropriately. See [Commercial vs. Transactional Email](https://www.airship.com/docs/developer/api-integrations/email/commercial-transactional/). ### Consent management Airship supports consent collection through: - **Forms and [Scenes](https://www.airship.com/docs/reference/glossary/#scene)** — Collect email addresses and marketing permissions directly in Airship or using your own forms. - **API integration** — Sync subscriber consent status from external systems. Your subscriber lists should only include recipients who have given the required consent for the type of messages you send. ## Unsubscribe handling and suppression management For commercial messages, Airship enforces unsubscribe compliance: - [**Unsubscribe links**](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/) — Add to templates or message footers. - **Automatic suppression** — Airship suppresses unsubscribed addresses, excluding from future commercial sends. - **Bounce handling** — Airship suppresses hard-bounced addresses to maintain deliverability. Airship also suppresses addresses marked as spam complaints, where feedback loops are available. Suppression helps you stay compliant and protect your sender reputation. See [Email Bounce Handling and Suppression](https://www.airship.com/docs/developer/api-integrations/email/bounce-handling/). You can review unsubscribed and suppressed addresses using the Contact Management tool. See [Removing email suppression](https://www.airship.com/docs/guides/audience/contact-management/#removing-email-suppression) in *Contact Management*. ## Data collection and tracking Airship collects email performance data such as delivery, open, click, bounce, spam complaint, and unsubscribe events. See [Data Collection for Email](https://www.airship.com/docs/developer/api-integrations/email/data-collection/). ### Tracking considerations Event tracking, specifically open tracking, in Airship operates using pixels placed in emails that detect opens through pixel rendering detection. Before enabling event tracking, ensure you have collected the appropriate consent and configured tracking accordingly. In many jurisdictions, pixel tracking must be disabled by default and is subject to prior consent. These are two standard methods for ensuring prior consent is received: - **Obtain consent at the time of email collection:** This method requires adequate disclosures, for example, information about the purposes of tracking and a link to an applicable privacy policy, and an opt-in checkbox that is not pre-selected when data subjects provide their email address. - **Obtain consent using a link embedded in an email without a tracking pixel:** This method may be appropriate after initial email collection. It requires sending an email without a tracking pixel that links to a page where recipients can review adequate disclosures and opt in to the use of tracking pixels using an opt-in checkbox that is not pre-selected. ### Tracking controls Configure tracking to align with your privacy commitments: - **Channel-level control** — Disable open and click tracking for specific email channels using Contact Management, CSV import, or API. See the following section, [Managing tracking opt-in status](#managing-tracking-opt-in-status). - **Message-level control** — Disable tracking for individual sends, even if the channel is opted in. ### Collecting open-tracking consent on your sign-up form Certain jurisdictions may require that prior consent for open pixel tracking be collected separately from consent to receive emails. This separate consent should be clearly labeled with a description of the tracking purpose. Through customer-hosted email sign-up forms, if you need to add a separate check box for email pixel tracking, you can pass the recipient's tracking consent status using the `open_tracking_opted_in` or `open_tracking_opted_out` field in the [Email channel registration API](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#registeremailchannel). This records consent at the channel level, and Airship will respect the tracking status on all subsequent sends to that channel. If a recipient does not check the tracking consent box, register the channel with an `open_tracking_opted_out` date. Use the `click_tracking_opted_out` field if click tracking consent is also required for your use case. ### Managing tracking opt-in status You have multiple options for managing the tracking opt-in status for an email channel: In the dashboard, go to **Audience**, then **Contact Management**, search for an email channel, and select the arrow icon (→) for the channel. You can then edit each tracking option. ![Enabled Open and Click tracking for an email channel in Contact Management](https://www.airship.com/docs/images/contact-mgmt-email-tracking_hu_230ef4bffbfc629d.webp) *Enabled Open and Click tracking for an email channel in Contact Management* The Contact Management tool is an [AXP](https://www.airship.com/docs/reference/feature-packages/) feature. If you are not on AXP, you can view Tracking for an email channel but not change status. See [Viewing channel details](https://www.airship.com/docs/guides/audience/contact-management/#viewing-channel-details) in *Contact Management*. Using CSV upload or the API, specify dates for `open_tracking_opted_in` / `open_tracking_opted_out` or `click_tracking_opted_in` / `click_tracking_opted_out` with: * [Create and Send](https://www.airship.com/docs/reference/glossary/#create_and_send) CSV upload in the Message composer or using the [Create and Send API](https://www.airship.com/docs/developer/rest-api/ua/operations/bulk-sending/#createandsend) * [CSV upload](https://www.airship.com/docs/reference/messages/csv-formatting/) for setting tags and attributes or for associating channels with [Named Users](https://www.airship.com/docs/reference/glossary/#named_user) * The [Email channel registration API](https://www.airship.com/docs/developer/rest-api/ua/operations/email/#registeremailchannel) By default, new channels are opted in to both open and click tracking. A channel can be opted out of tracking by setting an opted out date. The channel can be opted back in to tracking by setting an opted in date that is newer than the opted out date. ## Data access and auditing For compliance reporting and auditing, export email engagement data or stream events to your systems in real time using Airship's APIs. See [Compliance events for Email and SMS](https://www.airship.com/docs/guides/reports/real-time-data-streaming/#compliance-events-for-email-and-sms) in *Real-Time Data Streaming*.