snowflake-cloud-data-platformtasksnowpipe

How can i implement new feature snowflake email notification on snowpipe and Task


Can anyone provide use-case on new notification integration of type email

I wanted to implement this feature in snowpipe and task but i got error

"MY_EMAIL_INT" is a notification integration of type email which i have created 1

but when i used this integration on snowpipe parameter "Error_Integration = MY_EMAIL_INT" i got an error saying "SQL compilation error: Integration 'MY_EMAIL_INT' is not a notification integration."

Similarly in Task, when I used email type notification integration in error_integration parameter of task " SQL compilation error: Integration 'ERROR_INTEG' is not a valid notification integration for UserTasks."


Solution

  • You're getting an error because you're trying to use the wrong feature for the scope.

    You want to push error notifications for Snowpipe, therefore you need to create a push notification and not an email one, something like this example:

    CREATE [ OR REPLACE ] NOTIFICATION INTEGRATION [IF NOT EXISTS]
      <name>
      ENABLED = { TRUE | FALSE }
      DIRECTION = OUTBOUND
      TYPE = QUEUE
      cloudProviderParamsPush
      [ COMMENT = '<string_literal>' ]
    

    Check the distinction between push notifications versus email notifications on this link.

    If you want an email notification, that can only work in a task when called like a stored procedure, something like this:

    CALL SYSTEM$SEND_EMAIL(
        'my_email_int',
        'person1@example.com, person2@example.com',
        'Email Alert: Task A has finished.',
        'Task A has successfully finished.\nStart Time: 10:10:32\nEnd Time: 12:15:45\nTotal Records Processed: 115678'
    );