# Email Notification Configuration

The Snowflake CapStorm Salesforce Connector has the ability to send email messages on completion or failure of CopyStorm replication jobs. To securely enable this capability, a *Notification Integration* must be created and access must to the *Notification Integration* must be granted to the application. This page explains why this is necessary and provides the required steps for successful configuration.

## Why is a *Notification Integration* Required?

Snowflake enforces a **security-first** model for external communications. If an application needs to send notifications (e.g. through *SYSTEM$SEND\_EMAIL*), Snowflake requires:

* **Explicit declaration** of the allowed external notification service.
* **Controlled permissions** for which applications can use the integration.

This ensures:

* **Only approved applications** can send notifications.
* **External communication targets**(like email services) are tightly scoped.
* **Auditing and observability** are maintained for outgoing communications.

## Creating and Granting the *Notification Integration* to the Snowflake CapStorm Salesforce Connector

The below SQL can be utilized to successfully create a *Notification Integration* within the Snowflake environment and grant access to the Snowflake CapStorm Salesforce Connector. The following must be replaced in the provided SQL statements:

* DEFAULT\_RECIPIENTS: A comma separated list of email addresses that should receive the CopyStorm job completion emails.
  * e.g. ( ‘<example@capstorm.com>’, ‘<support@capstorm.com>’ )
* <>: The actual name of the application within the Snowflake environment.

### Identifying the Name of the Application

The following command can be executed within Snowflake to provide a list of applications available in the logged in Snowflake instance. The *name* field is the target name of the application that should be utilized in the *Notification Integration* grant.

```
/*
  Provides details about installed applications within the Snowflake instance.
*/
SHOW APPLICATIONS;
```

### SQL to Create and Grant Access

```
/*
  Creates the Notification Integration required for sending emails out of the
  Snowpark environment.
*/
CREATE NOTIFICATION INTEGRATION IF NOT EXISTS CapStorm_Notifications 
TYPE=EMAIL ENABLED=TRUE DEFAULT_RECIPIENTS = ( 'example@capstorm.com' ) DEFAULT_SUBJECT = 'CapStorm Job Notification';

/*
  Provides access to the notification integration for the application.
  NOTE: "<<Name of Application>>" must be replaced with the name of the application.
*/
GRANT USAGE ON INTEGRATION CapStorm_Notifications TO APPLICATION <<Name of Application>>;
```

## Utilizing the *Notification Integration* in the Snowflake CapStorm Salesforce Connector

After creating the *Notification Integration*, replication jobs can be configured to send job completion emails through the [*Setup* page](/snowflake-salesforce-connector/reference/setup-page.md).

## Configuring Email Notifications Within the CopyStorm Application

Email notifications for SFDC record replication jobs can be configured through the *Setup* page, but can also be manually configured through the CopyStorm application. To do so, navigate to the *Notifications* tab of CopyStorm, provide the list of desired email(s), and the configured integration name.

<figure><img src="/files/mkrvlBcu5e0i8swNrphd" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note that when manually providing the *Notification Integration* in the configuration file, the same steps listed in the [*Creating and Granting the Notification Integration to the Snowflake CapStorm Salesforce Connector*](https://learn.capstorm.com/snowflake-salesforce-connector/how-tos/email-notification-configuration#creating-and-granting-the-notification-integration-to-the-snowflake-capstorm-salesforce-connector) section must be taken to grant the application access to send emails through Snowflake.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/snowflake-salesforce-connector/how-tos/email-notification-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
