# Email Notification Basics

Email Notifications provide a simple way to send emails to the [Actor](../concepts/actors).

> 📘 To send an email to someone other than the Actor, you will need to use a Data Operation rather than a Notification. For more on this, see [Sending Emails by Data Operation](sending-emails-by-data-operation).

Like all Notifications, Email Notifications provide one-way outreach. There is no way to parse replies to Email Notifications. However, Email Notifications can still be used as calls-to-action. For instance, an Email Notification might contain a web link that recipients can click on or a reminder to prepare for an upcoming appointment.

> 📘 How are emails handled in Airkit? Emails get routed through Amazon SES and do not sit on Airkit servers. Mailboxes are also not hosted by Airkit and receiving emails are the responsibility of the mailbox owner. For more information see [App Security FAQ](../security-and-compliance/app-security-faq).

> 📘 Once an app is in production, is there a way to check on the status of the sent emails? The status of outgoing emails sent from all Apps within an Organization can be found in the Console, in the **Email** tab when examining an application under **App Health**. This provides insight into important information such as which and how many emails bounced, which and how many emails were marked as spam, and which and how many emails were delivered successfully. For more information, see [Console](../../console/console#app-health).

## Creating an Email Notification

Email Notifications are created in the [Notifications Builder](../studio/studio/builder-bar/notifications-builder).

New Notifications can be created by clicking on the '+' icon to the right of the **Notifications** section of the Tree, which provides the options to choose the type of Notification to create. Select **Email Notification**:

![](https://3333962744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbnBffrSN2FHLC5cM89AM%2Fuploads%2Fgit-blob-ff128bf88d144236d12778ebb70552d26b944974%2Femail-notification-basics-v183-0.png?alt=media)

An Email Notification consists of a subject and a body, both of which are defined in the Stage.

### Subject

The Subject is the string that will appear in the subject line when the Email Notification is received. Defining the Subject is done in an expression editor that accepts Airscript. This means that while the Subject can be generic and hardcoded, it can also use previously-collected user input to generate customized Subjects.

To hardcode a string, simply type the desired Subject between quotation marks, like so:

![](https://3333962744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbnBffrSN2FHLC5cM89AM%2Fuploads%2Fgit-blob-5f536011c2e78c93c2fa0072aeed6aa360031814%2Femail-notification-basics-v183-1.png?alt=media)

To insert an Airscript expression, place it inside of double curly braces. Note that the **Notifications Builder has access to all Global-, Profile-, and Theme-level variables.**

For instance, say the name of each user is saved as a global variable accessible under `session.name`. Referencing this variable within a simple Airscript expression makes it possible to personalize the Subject:

![](https://3333962744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbnBffrSN2FHLC5cM89AM%2Fuploads%2Fgit-blob-0474ce98e585f9c3f8514913ed5b803cd5af68a5%2Femail-notification-basics-v183-2.png?alt=media)

For more on Global-, Profile-, and Theme-level variables, see [Variable Scopes](../working-with-data/working-with-data-overview/variable-namespaces). For more on writing Airscript expressions, see [Airscript Quickstart](../working-with-data/working-with-data-overview/airscript-quick-start).

### Body HTML

The Body HTML section is where the email body is defined. The expression defining the email body will be parsed in HTML, though it can also access Airscript expressions.

To insert an Airscript expression, place it inside of double curly braces. Note that the **Notifications Builder has access to all Global-, Profile-, and Theme-level variables.** For more on Global-, Profile-, and Theme-level variables, see [Variable Scopes](../working-with-data/working-with-data-overview/variable-namespaces). For more on writing Airscript expressions, see [Airscript Quickstart](../working-with-data/working-with-data-overview/airscript-quick-start).

## Sending an Email Notification

Once a Notification is created, it can be sent:

* via the [Send Email](../data-operations/the-send-email-data-operation) Action, or
* as a direct part of the Journey by incorporating them into the [Journey Builder](https://github.com/airkit/airkit-docs/blob/master/docs/v18-3/journey-builder.md).

<details>

<summary>Where are outgoing Email Notifications sent?</summary>

\


Outgoing Notifications are sent to the Actor.

An Actor represents any individual who goes through an application flow. Actors are identified by their contact information, such as their phone number or email address. Once the relevant contact information is associated with an Actor, Notifications will be sent directly to the Actor via their established accounts. Tying contact information to an Actor is done via [Initializing the Actor](../actions/the-initialize-actor-action), which must be done before Notifications can be sent.

For a deeper dive into conceptualizing Actors, see [Actors](../concepts/actors). For a step-by-step walkthrough of how to initialize the Actor, see [Conversations with Actors](../concepts/actors/initializing-the-actor).

</details>

<details>

<summary>Where are outgoing Email Notifications sent from?</summary>

\


Outgoing SMS Notifications are sent from the **first** email associated with the application, which is defined in [Settings](../studio/studio/builder-bar/settings). For more on how to associate email addresses to Airkit, see [Connecting Email Addresses](connecting-email-addresses).

</details>

### Sending an Email Notification as an Action

Email Notifications can be sent via the [Send Email](../actions/send-email-notification-action) Action, which can be included in any Action Chain after the Actor has been initialized with a valid email address saved to `actor.email`.

#### To Initialize the Actor:

1. Determine the Actor's email address and make sure it is formatted according to the [Email](../variable-data-types/the-email-variable-data-type) Data Type. Use the [Set Variable](../actions/the-set-variable-action) Action to tie this value to `actor.email`.
2. In the same Action Tree in which `actor.email` was declared, follow its declaration with the [Initialize Actor](../actions/the-initialize-actor-action) Action to initialize the Actor.

#### To send a Notification:

1. Add the [Send Email](../data-operations/the-send-email-data-operation) Action to any Action Chain fired downstream of Actor Initialization. Select the Email Notification you want to send from the associated dropdown menu.
   * If you want to schedule an Email Notification rather than send it immediately, you can use it in tandem with the [Start Timer](../actions/the-start-timer-action) Action.
