<budget_name>!SET_EMAIL_NOTIFICATIONS

Set the email address(es) to receive budget notifications. Requires a notification integration that includes the email address(es).

See also:

<budget_name>!GET_NOTIFICATION_EMAIL, <budget_name>!GET_NOTIFICATION_INTEGRATION_NAME, <budget_name>!GET_NOTIFICATION_MUTE_FLAG, <budget_name>!SET_NOTIFICATION_MUTE_FLAG

Syntax

<budget_name>!SET_EMAIL_NOTIFICATIONS('<notification_integration>',
                                      '<email> [ , <email> [ , ... ] ]' )
Copy

Arguments

notification_integration:

Specifies the identifier for the email notification integration. The notification integration must include the email for budget notifications.

email:

Specifies the email address to receive notification emails. The email address(es) must be included in the allowed_recipients list of the notification_integration.

Returns

The email integration is updated.

Access Control Requirements

  • The following minimum privileges and roles are required to execute this method for custom budgets:

    • A role with ADMIN instance role for the budget instance.

    • A role granted the USAGE privilege on the database and schema that contains the budget instance.

  • To execute this method for the account budget:

    A role with any application role for the account budget.

Examples

Send email notifications for budget my_budget in the current schema to costadmin@domain.com and budgetadmin@domain.com:

CALL budget_db.budget_schema.my_budget!SET_EMAIL_NOTIFICATIONS(
   'budgets_notification', 'costadmin@domain.com, budgetadmin@domain.com');
Copy

Send email notifications for the account budget to budgetadmin@domain.com:

CALL snowflake.local.account_root_budget!SET_EMAIL_NOTIFICATIONS(
   'budgets_notification', 'budgetadmin@domain.com');
Copy

Error Messages

The following scenarios can help you troubleshoot issues that can occur.

Error

Unknown user-defined function
<database_name>.<schema_name>.<budget_name>.SET_EMAIL_NOTIFICATIONS

Cause

The role you used to set the email notifications for a custom budget does not have the ADMIN instance role.

Solution

Use a role with the required privileges and roles. See Access Control Requirements above.

Error

Integration '<INTEG_NAME>' does not exist or not authorized.

Cause

The notification integration does not exist.

Solution

Use a valid notification integration.

Error

FAILURE: Uncaught exception of type 'EXPRESSION_ERROR' on line 16 at
position 34 : Following email address(es) are not allowed by the
email integration <INTEGRATION_NAME>: [<email>]

Cause

The email addresses are not included in the notification integration.

Solution

Add the email addresses to the notification integration, or use a notification integration that includes all the email addresses in the ALLOWED_RECIPIENTS list.

Error

Email recipients in the given list at indexes [<index_list>] are not
allowed. Either these email addresses are not yet validated or do not
belong to any user in the current account.

Cause

Some or all of the email addresses you tried to add are not validated.

Solution

See Verifying the Email Addresses of the Notification Recipients.