Setting Up Notifications

Once a job schedule has been created, notifications can be added to it. Notifications can be sent to either a Magpie user based on the email address information in their user profile or to another email address that is manually specified. There are a two different conditions that can trigger a notification:

  • JobFinished: This notification will be sent regardless of the outcome of a job schedule execution, whether it fails or succeeds.
  • JobFailed: This notification is sent only when the execution of the job schedule fails.

The following is an example of setting up notifications that sends an emails based on different conditions.

create notification subscription {
  "trigger": "JobFinished",
  "channel": {
    "channelType": "UserEmail"
  }
} for schedule refresh_property_table.every_day;

create notification subscription {
  "trigger": "JobFailed",
  "channel": {
    "channelType": "CustomEmail"
    "to":"my_email_address@test.com"
  }
} for schedule refresh_property_table.every_day;

Note, that with channelType equal to UserEmail, it is not necessary to specify a user. The user creating the subscription is made the recipient by default. A notification can be sent to multiple users by creating a notification for each Magpie user or email address that needs to be notified.

Was this article helpful?
0 out of 0 found this helpful