> For the complete documentation index, see [llms.txt](https://learn.capstorm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.capstorm.com/snowflake-salesforce-connector/how-tos/email-notification-configuration.md).

# 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="https://3213705989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAxXqskcxjs2ntjTUVWmF%2Fuploads%2Fy4jx17GmYGkk8jFrbljc%2FSnowpark%20CopyStorm%20Notifications.png?alt=media&amp;token=0601c41a-e9c4-4dcc-a7c5-82ff78e0f0ce" 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 %}
