> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an email notifier

> Create an email notifier with Palo Alto Networks Cortex XCOR, Chronoctl, or Terraform.

Create an email notifier to send monitor alerts to a specific email address. Before you
create the notifier, identify the destination email address.

Select from the following methods to create an email notifier. You can use
[variables](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers#use-variables-in-notifiers) in your
notifiers.

> [tab] Web
>
> 1. In the navigation menu select
>    \*\* Alerting > Notifiers\*\*.
> 2. Click **Create notifier**.
> 3. Enter a descriptive name for the notifier.
> 4. Select **Email** as the type of notifier you want to create.
> 5. In the **Email** field, add the destination email address.
> 6. Optional: In the **Body** field, enter HTML or text body content.
> 7. Optional: Select **Notify when resolved** to send a resolved alert notification.
> 8. Click **Save**.

> [tab] Chronoctl
>
> To create one or more notifiers using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), create a YAML file
> that defines them and apply the configuration to your instance.
>
> > [!NOTE]
> >
> > You can use the `notifiers scaffold` command to generate an example notifier, and
> > then copy the resource definition for your notifier type:
> >
> > ```shell theme={null}
> > chronoctl notifiers scaffold
> > ```
>
> 1. Define the resource definition for your email notifier:
>
>    ```yaml Chronoctl example icon="square-terminal" /NAME/ /SLUG/ /ADDRESS/ theme={null}
>    api_version: v1/config
>    kind: Notifier
>    spec:
>      name: NAME
>      slug: SLUG
>      skip_resolved: true
>      email:
>        to: ADDRESS
>        html: '<b>Alert triggering</b>'
>        text: 'Alert triggering'
>    ```
>
>    Replace the following:
>
>    * *`NAME`*: A descriptive name, such as `team-email`.
>    * *`SLUG`*: A unique identifier, such as `team-email`.
>    * *`ADDRESS`*: An email address destination for the notifier.
>
> 2. Optional: Update the `html` or `text` keys to include custom HTML or text body
>    content.
>
> 3. Apply the changes:
>
>    ```shell /FILE_NAME/ theme={null}
>    chronoctl apply -f FILE_NAME.yaml
>    ```
>
>    Replace *`FILE_NAME`* with the name of your notifier YAML file.

> [tab] Terraform
>
> To create an email notifier:
>
> 1. Create an email notifier with [Terraform](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform) by using the
>    `chronosphere_email_alert_notifier` type followed by a name in a resource
>    declaration:
>
>    ```terraform Terraform example icon="square-terminal" theme={null}
>    resource "chronosphere_email_alert_notifier" "email_notifier" {
>      name = "Email Notifier"
>
>      # Optional slug of the email notifier.
>      slug = "email-notifier"
>
>      ## Notifier-specific required configuration
>      # For detailed definitions, see
>      # https://prometheus.io/docs/alerting/latest/configuration/#email_config
>      to = "recipient@example.com"
>
>      ## Notifier-specific optional configurations
>      html = "<b>Alert triggering</b>"
>      text = "Alert triggering"
>    }
>    ```
>
> 2. Modify the `to` key to add the destination email address.
>
> 3. Optional: Update the `html` or `text` keys to include custom HTML or text body
>    content.
>
> 4. Run `terraform apply` to create the notifier resource.
>
>    ```shell theme={null}
>    terraform apply
>    ```

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the `email` object in the
> [`CreateNotifier`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateNotifier) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.


## Related topics

- [Notifiers](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers.md)
- [Integrate with Cortex XCOR](https://docs-xcor.paloaltonetworks.com/integrate.md)
- [Create a discard notifier](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers/discard.md)
- [CreateNotifier](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateNotifier.md)
- [Create an Opsgenie notifier](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers/opsgenie.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.