# Email content

Send messages to your email channel.

For best practices, see [Email Deliverability](https://www.airship.com/docs/developer/api-integrations/email/deliverability/) and [Email Compliance](https://www.airship.com/docs/developer/api-integrations/email/compliance/). See also the [Email](https://www.airship.com/docs/guides/features/messaging/email/) feature guide.

## Creating content

<p>When creating messages, you configure their appearance in the Content step. In the Delivery step, you can configure content-related features that do not affect the appearance.</p>

In the *Content* step, click **Add content**. Now you can configure the body of the message:
* For each section, click **Edit 
** or **Add **, make your changes, then click **Done**.
Merge fields can be included in HTML and plain text content if you chose Upload Users in the Audience step.
* If your message includes [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars), you can preview how the content will appear. See [Previewing personalized content](https://www.airship.com/docs/guides/personalization/previewing/).

![Configuring email content](https://www.airship.com/docs/images/composer-content-email_hu_f156989fe2bb2555.webp)

*Configuring email content*

1. (Optional) Edit sender information:
   | Setting | Description | Steps |
   | --- | --- | --- |
   | **From Name, From Email, and Reply to Email** | The name and email addresses to use in the message header. They also appear in the user's email client.<p>The **From Name** and the usernames in the **From Email** and **Reply to Email** addresses support personalization using [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars). The username is what appears before the @ symbol in the email address. See [About Personalization](https://www.airship.com/docs/guides/personalization/about/). | Edit the fields and select from available domains for the email addresses. For **Reply to Email**, leave field blank if replies should go to the address already entered in **From Email**. |
   | **Transactional** | If the message is triggered by a user's action such as a password reset request, opt-in, shopping receipt, etc., you can designate it as transactional, and optionally include an [unsubscribe link](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/). See [Commercial vs. Transactional Email](https://www.airship.com/docs/developer/api-integrations/email/commercial-transactional/)<p>The Content step is considered incomplete until an unsubscribe link is provided in the message body or the message is designated as transactional in Sender Information. | Enable to designate the message as transactional. |
   | **Bypass Opt-in Status** | Sends the message to audience members even if they have opted out of transactional messages. This option appears if **Transactional** is enabled.<p>Use for business-critical emails only. See [Opt-in and Opt-out Requirements](https://www.airship.com/docs/developer/api-integrations/email/commercial-transactional/#opt-in-reqs) in *Commercial vs. Transactional Email*. | Enable to send the message to users who opted out of transactional messages. |
   | **Open and Click Tracking** | Records an event when the email is opened and/or links are clicked. Only HTTP and HTTPS links are tracked. Enabled by default.<p>When enabled, opens and clicks are tracked for all channels that have not been opted out. When disabled, opens and clicks are not tracked for any channels. See [Contact Management](https://www.airship.com/docs/guides/audience/tools/contact-management/) to manage open and click tracking at the channel level. | Enable to track opens and clicks. |
   | **BCC Addresses** | For accounts with email addresses registered with Airship for BCC capabilities. Sends a blind copy of the message to selected email addresses.<p>It's important to keep email volume in mind when using BCC. When you send a message with BCC enabled, your BCC addresses receive one email for each recipient of that message. | Select email addresses. |
   {class="table-col-1-20 table-col-2-40"}
   ![Email sender information](https://www.airship.com/docs/images/email-sender-info_hu_ac2fbe975730e1dc.webp)
   
   *Email sender information*

1. Add the *Subject*.

1. (Optional) Add the *HTML body*.
   <ul>
   <li>For <strong>HTML</strong>, select the paste or upload option and add your HTML.</li>
   <li>For <strong>drag-and-drop</strong>, select a default or <a href="https://www.airship.com/docs/guides/messaging/editors/interactive/saving-layouts/">saved layout</a>, or select <strong>Blank Layout</strong> to design your own. Then you can design your content. See <a href="https://www.airship.com/docs/guides/messaging/editors/interactive/styling-formatting/">Styling and formatting in the Interactive editor</a>. You can edit any layout after selecting.</li>
   </ul>
   
   In the Interactive editor:
   * To [reduce the HTML size](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#size-limit-and-html-minification), select **Settings** in the sidebar, and then enable **Minify HTML**.
   * After selecting **Done**, choose whether to save the HTML body only or [also generate the plain text body](https://www.airship.com/docs/guides/features/messaging/email/#plain-text-generation).

1. Add the *Plain text body* or edit if populated in the previous step.

1. (Optional) [Preview your email](#inbox-previews) in different clients:
   > **Warning:** Inbox renderings are generated using [Litmus](https://www.litmus.com/). To protect the privacy of your contacts, do not include personal information in your email content when generating previews.
   
   <ol>
   <li>Select <strong>Inbox preview</strong>.</li>
   <li>Select from the lists of browser, desktop, and mobile clients, then click <strong>Generate previews</strong>.</li>
   <li>Select a thumbnail to see the full version. Select the close icon () to close and choose another preview.</li>
   <li>(Optional) To add/remove clients, Select <strong>Reselect and generate previews</strong> and start over.</li>
   <li>When you are finished with inbox previews, select the close icon () to close the modal.</li>
   </ol>

Now you are ready to complete the remaining steps in the composer. If your message requires overriding project-level [URL parameters](#url-parameters), set overrides in the Delivery step.

## Size limit and HTML minification

Message size should not exceed 100 KB, as email clients typically truncate content larger than 103 KB. If you need to provide content exceeding this limit, link from the email to web-hosted content.

When using the drag-and-drop option in Interactive editor for an email HTML body, you can [reduce the overall size of your content by up to 25%](https://www.airship.com/docs/guides/features/messaging/email/#html-minification).

First, [Contact Support](https://support.airship.com) to request enabling HTML minification for your project, and include your project [app key](https://www.airship.com/docs/reference/glossary/#app_key). To access it, next to your project name, select the dropdown menu (), then **Project Details**.

After it's enabled, you can use it in the editor for your email messages and templates: Select **Settings** in the sidebar, and then enable **Minify HTML**.

When applying the setting to an existing message, you do not need to change anything else in the message before saving.

## Inbox previews

> **Note:** Inbox previews must be enabled for your account. Contact your Airship account manager if they do not appear for your projects.


After adding the HTML body in a message or template, you can select **Inbox preview** to see how it will look in various browser, desktop, and mobile email clients.

* Each browser, desktop, or mobile selection counts as one preview. If you edit a message and then regenerate previews, the new previews are counted separately from the original previews.
* Each Airship project includes a limited number of free previews per month. Additional previews are billed at the end of the month.
* Your preview count for the current month is displayed at the bottom of the inbox preview modal. The number of previews to generate appears after you select clients.

![Selecting email clients for inbox previews](https://www.airship.com/docs/images/inbox-preview_hu_42e03bc9d275e959.webp)

*Selecting email clients for inbox previews*

## Preheader text

Preheader text is a short line of text that displays after or below an email subject line in an inbox. You can also have the text appear in the message body. Preheader text is an easy way to expand on your subject line and improve email open rates. Not all email clients support preheader text. These examples show preheader text following the subject "Undock is Launching":

![Preheader text in a browser inbox](https://www.airship.com/docs/images/preheader-text_hu_d64919cb62911960.webp)

*Preheader text in a browser inbox*
<br>

![Preheader text in a mobile inbox](https://www.airship.com/docs/images/preheader-text-mobile_hu_39260b017aa0439c.webp)

*Preheader text in a mobile inbox*

While some clients will display more than 100 characters, we recommended 40-100 characters, to make sure your message is fully displayed in most email clients and browser windows. However, if most of your recipients are opening their messages on mobile devices, consider keeping your character count on the lower end, since many devices display an average of 35-50 characters.

* The Interactive editor supports preheader text in the inbox, or in both the inbox and the body of the message. See [Preheader text for email](https://www.airship.com/docs/guides/messaging/editors/interactive/styling-formatting/#preheader-text-for-email) in *Styling and formatting in the Interactive editor*.

* If providing your own HTML, you can add preheader text that appears in the **inbox only**. Add this snippet of code to the top of your HTML body, and edit "Preheader text goes here." with the message you'd like to use:
   ```html
<div style="display:none !important;
      visibility:hidden;
      mso-hide:all;
      font-size:1px;
      color:#ffffff;
      line-height:1px;
      max-height:0px;
      max-width:0px;
      opacity:0;
      overflow:hidden;">
   Preheader text goes here.
   </div>
```


## Link names

Name your email links to better understand their performance. You can add them manually using the HTML attribute `data-ua-linkname` on anchor tags or enter them when configuring actions in the [Interactive editor](https://www.airship.com/docs/guides/messaging/editors/interactive/about/).

When users follow links in an email, the URLs and related metrics appear in the Performance section of a message report. See [Email Performance](https://www.airship.com/docs/guides/reports/message/#email-performance) in *Message Reports*.

Link names also appear in [Real-Time Data Streaming](https://www.airship.com/docs/reference/glossary/#rtds) as the value for the `link_name` property in the `email_click` event body. See [Email click event](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-email-events/#emailclickevent) in the *Real-Time Data Streaming API* reference. In the [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa) Engagement Explore, you can use the Link Name [Dimension](https://www.airship.com/docs/guides/reports/analytics/exploring/about/#the-explore-view). See [General data](https://www.airship.com/docs/guides/reports/analytics/email/#general-data) in the *Email in Performance Analytics* guide.

### Entering link names in messages

In layouts in the Interactive editor, you can provide a link name when configuring the actions **Open website**, **Open unsubscribe page**, and **Confirm subscription**. See [Email and link actions](https://www.airship.com/docs/guides/messaging/editors/interactive/actions/#email-and-link-actions) in *Actions in the Interactive editor*.

If you entered the link name "jawn" for URL `https://www.example.com`, it would appear in the message HTML like so:

```html
<a data-ua-linkname="jawn" target="_blank" href="https://www.example.com" rel="noopener">here</a>
```


Use the above format to manually add link names to email HTML bodies.

### Creating link name Segments

When creating a [segment](https://www.airship.com/docs/reference/glossary/#segment), use the `email_click` event, add the `link_name` property, and enter a link name as the property value.

## URL parameters

URL parameters are variables you can automatically append to all link URLs in emails. They function as tags for tracking campaign performance, both on the web and in an app. You can use platforms like Google Analytics to track user behavior after they've followed a link.

Add your own custom parameters and/or supply values for these [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters):

| UTM parameter | Description | Usage example |
| --- | --- | --- |
| utm_campaign | Identifies the purpose of the campaign or promotion | utm_campaign=winter_clearance |
| utm_content | Identifies what the user interacted with in the email, such as a button or a text link, and differentiates links that may direct to the same URL, as is commonly used in A/B testing | utm_content=sign-up-button |
| utm_medium | Identifies where a user found your URL | utm_medium=email |
| utm_source | Identifies the traffic source, which you can use to identify the type of email campaign | utm_source=newsletter |
| utm_term | Typically identifies search terms, but instead can be used to differentiate things like subject lines | utm_term=you-forgot-your-cart |

A full link could look like this: `https://example.com/utm_medium=email&utm_source=newsletter&utm_campaign=winter_clearance&utm_content=sign-up-button`.


URL parameters can be set at the project level and for individual messages. You can override project-level parameters per message as well. URL parameters already defined or hardcoded into your email links will not be overridden.

URL parameters are supported for the API and for messages created using the Message, A/B Test, Automation, and Sequence composers.

---

Names of custom parameters should be formatted according to your analytics platform requirements. Values for both UTM and custom parameters accept all characters and support [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars).
   * Handlebars values are automatically [URL-encoded](https://www.airship.com/docs/guides/personalization/handlebars/basics/#url-encoding).
   * You can use [message namespace properties](https://www.airship.com/docs/guides/personalization/sources/message-namespace/), event properties, and the `global_attributes` property in the [Push Object](https://www.airship.com/docs/developer/rest-api/ua/schemas/push/#pushobject) with Handlebars personalization.
   * Handlebars support does not include stored [attribute](https://www.airship.com/docs/reference/glossary/#attribute) values on channels and [named users](https://www.airship.com/docs/reference/glossary/#named_user).

Dynamic values can be appended or prepended to static text or used standalone. For example, you can set a custom value for `utm_content` as `newsletter-{{dateFormat $message.date pattern="yyyy-MM-dd"}}`, which will append `utm_content=newsletter-11-25-24` to the URL.

### Setting URL parameters

To set URL parameters for all link URLs contained in emails:

1. Next to your project name, select the dropdown menu (), then **Settings**.
1. Under **Project settings**, select **URL Parameters**.
1. Under **UTM Parameters**, enter values for each parameter. Parameters left empty will not be included in email URLs.
1. Under **Custom Parameters**, select ** Add custom parameter**, then enter a parameter name and value.
1. Select **Save**.
   > **Note:** Changes made to project-level email URL parameters will apply to all active Automations and Journeys. Changes will not apply to messages that are currently being delivered.


You can set parameters for an individual message in the Delivery step in the Message, A/B Test, Automation, and Sequence composers. See [URL parameters](https://www.airship.com/docs/guides/messaging/messages/delivery/delivery-options/#url-parameters) in *Message delivery options*.

For API use, see the `url_parameters` object in [Email Override](https://www.airship.com/docs/developer/rest-api/ua/schemas/platform-overrides/#emailoverrideobject) and [Email Notification with Template](https://www.airship.com/docs/developer/rest-api/ua/schemas/platform-overrides-with-templates/#emailoverridewithtemplate).

## Disabling click tracking for specific links

You set click tracking for a message when configuring its [Sender Information](#creating-content). When tracking is enabled for a message, you can override the setting and disable tracking for message specific links and actions.

In layouts in the Interactive editor, you can disable click tracking for text hyperlinks and for the actions **Open website** and **Confirm subscription**. See [Email and link actions](https://www.airship.com/docs/guides/messaging/editors/interactive/actions/#email-and-link-actions) in *Actions in the Interactive editor*.

In HTML or plaintext content, in either the dashboard or using the API, you can disable click tracking by including these parameters:

   * In HTML, use the `data-ua-clicktrack="0"` attribute on an anchor tag to remove click tracking for a link.
      **Tracked and untracked HTML links**

      ```html
<a href="https://airship.com">My Tracked Link</a>

      <a data-ua-clicktrack="0" href="https://airship.com">My Untracked Link</a>
```


   * In plaintext, use the format `[[ua-clicktrack-disabled="1" href="<URL>"]]` to disable click tracking.
      **Tracked and untracked plaintext links**

      ```plaintext
[My Tracked Link]
      https://airship.com

      [My Untracked Link]
      [[ua-clicktrack-disabled="1" href="https://airship.com"]]
```


## Unsubscribe events

Airship captures email unsubscribe activity through integrations with email service provider partners and forwards events to [Real-Time Data Streaming (RTDS)](https://www.airship.com/docs/reference/glossary/#rtds) for reporting. The events that are emitted depend on whether the user opted out of email messaging entirely or only out of a specific [subscription list](https://www.airship.com/docs/reference/glossary/#subscription_list).

### Unsubscribing from email messaging

When users opt out of email messaging, Airship sets either a `commercial_opted_out` or `transactional_opted_out` timestamp on the email channel based on the message type, then emits three RTDS events:

* A `CUSTOM` [Email unsubscribe link event](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-email-events/#emailunsubscribelinkevent) with `name: unsubscribe`
* A [Subscription event](https://www.airship.com/docs/developer/rest-api/connect/schemas/events/#subscription) of type `SUBSCRIPTION`
* A [Compliance event](https://www.airship.com/docs/developer/rest-api/connect/schemas/email-compliance-events/#unsubscribe) of type `COMPLIANCE` with `body.event_type: registration` and `body.properties.registration_type: unsubscribe`

Three actions can produce a messaging unsubscribe. Use the `unsubscribe_event_type` property to identify the source:

| Source | Description | `unsubscribe_event_type` value |
| --- | --- | --- |
| **Email client** | User selected the unsubscribe button in their email client, generated from the [`List-Unsubscribe` email header](https://datatracker.ietf.org/doc/html/rfc2369) | `list_unsubscribe` |
| **Message body** | User selected an [email body unsubscribe link](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/) (`data-ua-unsubscribe`) | `link_unsubscribe` |
| **Preference Center** | User selected the **Unsubscribe from all** button in the Email [Preference Center](https://www.airship.com/docs/reference/glossary/#preference_center) | `link_unsubscribe` |

The `unsubscribe_event_type` value appears on the `CUSTOM` event at `body.properties.unsubscribe_event_type` and on the `SUBSCRIPTION` event at `body.event_type`. The `COMPLIANCE` event does not carry the source identifier, so use the companion `CUSTOM` or `SUBSCRIPTION` event to attribute the unsubscribe.

The email body link and the **Unsubscribe from all** Preference Center button share the same `unsubscribe_event_type` value because they use the same API endpoint. To distinguish them, check for `triggering_push` on the `CUSTOM` event: only the email body link includes it.

The **Unsubscribe from all** Preference Center action also emits a `SUBSCRIPTION_LIST` event listing every subscription list the user was removed from, since the action removes them from all lists at once.

### Unsubscribing from a subscription list

When users opt out of one or more subscription lists without opting out of email entirely, Airship does not change the channel's opt-out timestamps. The events differ from a full opt-out, and the source determines which events are emitted:

| Source | Description | Events emitted |
| --- | --- | --- |
| **Message body** | User selected a subscription list unsubscribe link in the email body ([`data-ua-list-unsubscribe`](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/#unsubscribe-link-formatting)) | `SUBSCRIPTION`, `COMPLIANCE`, and `SUBSCRIPTION_LIST` |
| **Preference Center** | User changed a per-list selection in the Email [Preference Center](https://www.airship.com/docs/reference/glossary/#preference_center) | `SUBSCRIPTION_LIST` only |

For email body link unsubscribes, the `SUBSCRIPTION` and `COMPLIANCE` events both include a `subscription_lists.canceled` array containing the IDs of the lists the user was removed from. This array is the signal that the event represents a subscription list unsubscribe rather than a full opt-out. The `COMPLIANCE` event still has `body.properties.registration_type: unsubscribe`, but no opt-out timestamps are set on the channel.

The [Subscription list event](https://www.airship.com/docs/developer/rest-api/connect/schemas/events/#subscription-list) (`SUBSCRIPTION_LIST`) uses the same schema for both directions of change. Its body contains `enrolled`, `canceled`, and `current` arrays of list IDs, so the same event type covers both subscriptions and unsubscribes.

See also:

* [Email unsubscribe links](https://www.airship.com/docs/guides/messaging/messages/content/email/email-unsubscribe-links/)
* [Email data collection](https://www.airship.com/docs/developer/api-integrations/email/data-collection/)
* [Targeting your audience using events](https://www.airship.com/docs/guides/audience/events/targeting/)
* [Email unsubscribe](https://www.airship.com/docs/reference/data-collection/events/#unsubscribe) in *Events reference*

## Open tracking links

Email recipients can provide or withdraw their consent for open tracking by clicking links in your email content. When a recipient selects one of these links, Airship opens a confirmation page where they can complete the action, then updates the `ua_open_tracking_opted_out` or `ua_open_tracking_opted_in` delivery attribute depending on the recipient's selection:

* **Opt out:** Airship excludes tracking pixels from future emails and ignores them when previously sent emails are opened.
* **Opt in:** Airship includes tracking pixels in future emails and processes them when previously sent emails are opened.

In the Interactive editor, add the links using the [Opt in to open tracking](https://www.airship.com/docs/guides/messaging/editors/interactive/actions/#opt-in-to-open-tracking) and [Opt out of open tracking](https://www.airship.com/docs/guides/messaging/editors/interactive/actions/#opt-out-of-open-tracking) actions.

In HTML or plaintext content, in either the dashboard or using the API, you can add open tracking links by including these parameters. In both formats, replace the `href` URL with the URL of your own confirmation page, or omit the `href` to use the default confirmation page.

   * In HTML, use the attributes `data-ua-open-tracking-opt-out="1"` and `data-ua-open-tracking-opt-in="1"` on anchor tags.
      **Opt-out and opt-in HTML links**

      ```html
<a data-ua-open-tracking-opt-out="1" href="https://www.example.com/opt-out">Opt out of open tracking</a>

      <a data-ua-open-tracking-opt-in="1" href="https://www.example.com/opt-in">Opt in to open tracking</a>
```


   * In plaintext, use the formats `[[ua-open-tracking-opt-out]]` and `[[ua-open-tracking-opt-in]]`.
      **Opt-out and opt-in plaintext links**

      ```plaintext
[[ua-open-tracking-opt-out href="https://www.example.com/opt-out"]]

      [[ua-open-tracking-opt-in href="https://www.example.com/opt-in"]]
```


## Preference Centers

To link to an Email [Preference Center](https://www.airship.com/docs/reference/glossary/#preference_center) in a message, first get its web page URL:

1. Go to **Content**, then **Web Pages**.
1. Select the more menu icon () for a Preference Center web page, then **Copy link to clipboard**.

Now you can include the saved URL in a link in your message.

## Deep Links in email

You can use a Deep Link to direct users from an email to a specific location within your app. For Deep Links to work properly with Airship email, you must have the following:

* A branded click tracking domain configured in Airship
* An `apple-app-site-association` and `assetlinks.json` files hosted using HTTPS at the root of your domain
* Code in your Android and iOS apps that resolves the click-tracking links and routes to the proper page in your app

Follow the steps below to set up your website and app, and then add Deep Links to your messages.

Links to additional documentation for Airship's email providers SendGrid and SparkPost are provided. If you do not know which provider your account uses, [contact Airship Support](https://support.airship.com/).

### Configure your website to handle Deep Links

Android and iOS devices handle Deep Link resolution using files hosted alongside your website. Customize the following files to match your iOS `appID` and Android `sha256_cert_fingerprints` and place them at the root of your domain. They must be hosted using HTTPS.

For iOS, add the following to your `apple-app-site-association` file:
```json
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "<YOUR_APP_ID>",
        "paths": [
          "/uni/*",
          "/f/open-in-app/*"
        ]
      }
    ]
  }
}
```

For Android, add the following to your `assetlinks.json` file:
```json
[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example.testlinks",
    "sha256_cert_fingerprints":
    ["<YOUR_APP_FINGERPRINT>"]
  }
}]
```

For additional information, see [Support Universal Links](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html) in the Apple Developer *App Search Programming Guide* and [Getting Started](https://developers.google.com/digital-asset-links/v1/getting-started) in the Google *Digital Asset Links* guide.

### Configure your apps to handle Deep Links

Add the following code to your Android and iOS apps to resolve the click-tracking links and route to the proper page in your app. These code samples are provided for reference and may need to be adjusted to work in your application.


#### iOS Swift


```swift
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
    if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
        guard let encodedURL = userActivity.webpageURL else {
            // No URL to resolve
            return false
        }
        let task = URLSession.shared.dataTask(with: encodedURL, completionHandler: { (data, response, error) in
            guard let resolvedURL = response?.url else {
                // URL failed to resolve
                return
            }
            // Now you have the resolved URL that you can
            // use to navigate somewhere in the app.
            print(resolvedURL)
        })
        task.resume()
    }
    return true
}
```



#### Android Java


```java
protected void onNewIntent(Intent intent) {
    String action = intent.getAction();
    final String encodedURL = intent.getDataString();
    if (Intent.ACTION_VIEW.equals(action) && encodedURL != null) {
        new Thread(new Runnable() {
            public void run() {
                try {
                    URL originalURL = new URL(encodedURL);
                    HttpURLConnection ucon = (HttpURLConnection) originalURL.openConnection();
                    ucon.setInstanceFollowRedirects(false);
                    URL resolvedURL = new URL(ucon.getHeaderField("Location"));
                    // Redirect to the correct page in your app
                }
                catch (MalformedURLException ex) {
                    //
                }
                catch (IOException ex) {
                    //
                }
            }
        }).start();
    }
}
```




For additional information, see [Universal Links](https://www.twilio.com/docs/sendgrid/ui/sending-email/universal-links) in the Twilio SendGrid *Sending Email* documentation and [Using Mobile Universal and App Links with SparkPost](https://support.sparkpost.com/docs/tech-resources/deep-links-self-serve) in the SparkPost *Tech Resources* documentation.

### Add Deep Links in messages

In layouts in the Interactive editor, select the **Deep Link** action for text, buttons, or images in your messages, and then enter your Deep Link URL. You can also provide a [link name](#link-names) for tracking purposes. For all available actions, see [Email and link actions](https://www.airship.com/docs/guides/messaging/editors/interactive/actions/#email-and-link-actions) in *Actions in the Interactive editor*.

---

To use Deep Links with click tracking, SendGrid provides specific instructions for "Universal Links". SparkPost refers to these as "Deep Links". These instructions can be found in their documentation, but we've summarized them here.

The editor will automatically add the necessary `universal="true"` or `data-msys-sublink="open-in-app"` attribute to the link, ensuring it functions correctly with our Email subprocessors.

---

In HTML or plaintext content, in either the dashboard or using the API, you can add Deep Link handling to URLs by including these parameters:

* In HTML, add the `data-ua-universal="true"` attribute to your Deep Link URLs:
   ```html
   <a href="your-deep-link-url" data-ua-universal="true">Your Deep Link Text</a>
   ```

* In plaintext, add `ua-universal="true"` to your Deep Link URLs:
   ```plaintext
   [Your Deep Link Text]
   [[ua-universal="true" href="your-deep-link-url"]]
   ```
   > **Note:** SendGrid does not support click tracking in plaintext links, so you may need to adjust your links in your plaintext copy.

