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.
alter job schedule refresh_property_table.every_day add notification subscription { "trigger": "JobFinished", "channel": { "channelType": "Email" } }; alter job schedule refresh_property_table.every_day add notification subscription { "trigger": "JobFailed", "channel": { "channelType": "Email", "to": "my_email_address@test.com" } };
Note, that it is not necessary to specify an email address for an Email notification channel. 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.