Categories:

Notification functions (Integration Configuration)

EMAIL_INTEGRATION_CONFIG

Returns a JSON object that specifies the email notification integration, recipients, and subject line to use for an email notification. This is a helper function that you use to construct an integration configuration object for the SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure.

See also:

Using SYSTEM$SEND_SNOWFLAKE_NOTIFICATION to send notifications , SYSTEM$SEND_SNOWFLAKE_NOTIFICATION , INTEGRATION

语法

SNOWFLAKE.NOTIFICATION.EMAIL_INTEGRATION_CONFIG(
  '<email_integration_name>',
  '<subject>',
  <array_of_email_addresses_for_to_line> )
SNOWFLAKE.NOTIFICATION.EMAIL_INTEGRATION_CONFIG(
  '<email_integration_name>',
  '<subject>',
  <array_of_email_addresses_for_to_line>,
  <array_of_email_addresses_for_cc_line>,
  <array_of_email_addresses_for_bcc_line> )

实参

'email_integration_name'

要使用的电子邮件通知集成的名称。

'subject'

电子邮件的主题。

主题长度不能超过 256 个字符。

array_of_email_addresses_for_to_line
array_of_email_addresses_for_cc_line
array_of_email_addresses_for_bcc_line

要包含在邮件的“收件人:”、“抄送:”和“密送:”行中的电子邮件地址 ARRAYs。

You must specify email addresses of users in the current account. These users must verify their email addresses.

If the ALLOWED_RECIPIENTS property is set to a list of email addresses in the email notification integration, the email addresses must be in that list.

Call the ARRAY_CONSTRUCT function to construct each ARRAY.

Note

如果仅指定“密送:”行,则无法发送电子邮件通知。

返回

A JSON-formatted string that specifies a notification integration for the SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure to send.

For example, suppose that you pass in the notification integration name 'my_email_int' with the following subject line and list of email addresses for the “To:” line:

SELECT SNOWFLAKE.NOTIFICATION.EMAIL_INTEGRATION_CONFIG(
  'my_email_int',
  'Updates',
   ARRAY_CONSTRUCT('person_a@example.com', 'person_b@example.com')
)

该函数会返回以下 JSON 格式的字符串:

'{"my_email_int":{"subject":"Updates","toAddress":["person_a@example.com","person_b@example.com"]}}'

The following example sends the same notification with an additional list of email addresses for the “Cc:” line. Note that this example passes NULL for the “Bcc:” addresses to exclude the bccAddress property from the returned object.

SELECT SNOWFLAKE.NOTIFICATION.EMAIL_INTEGRATION_CONFIG(
  'my_email_int',
  'Updates',
   ARRAY_CONSTRUCT('person_a@example.com', 'person_b@example.com'),
   ARRAY_CONSTRUCT('cc_person_a@example.com'),
   NULL
)

该函数会返回以下 JSON 格式的字符串:

'{"my_email_int":{"subject":"Updates","toAddress":["person_a@example.com","person_b@example.com"],"ccAddress":["cc_person_a@snowflake.com"]}}'

以下示例发送相同的通知,其中包含“密送:”行的其他电子邮件地址列表:

SELECT SNOWFLAKE.NOTIFICATION.EMAIL_INTEGRATION_CONFIG(
  'my_email_int',
  'Updates',
   ARRAY_CONSTRUCT('person_a@example.com', 'person_b@example.com'),
   ARRAY_CONSTRUCT('cc_person_a@example.com'),
   ARRAY_CONSTRUCT('bcc_person_b@example.com')
)

该函数会返回以下 JSON 格式的字符串:

'{"my_email_int":{"subject":"Updates","toAddress":["person_a@example.com","person_b@example.com"],"ccAddress":["cc_person_a@example.com"],"bccAddress":["bcc_person_b@example.com"]}}'

示例

See Using SYSTEM$SEND_SNOWFLAKE_NOTIFICATION to send notifications.