Receiving Notifications

Cadence.NET can notify you when a task starts, completes, or throws an exception, using various channels.

As of this release, Cadence.NET can notify via email (SMTP) or by the popular notification service "Pushover" (http://www.pushover.net). Pushover accounts are free to create, but you must download the app to your device for a nominal fee (at the time of this writing it was $4.99 USD).

To configure your task to use notifications, you must add the NotificationBehavior attribute to your task like so:

[NotificationBehavior(
    NotifyOnTaskComplete = true, 
    NotifyOnTaskError = true, 
    NotifyOnTaskStart = true, 
    NotificationMethods = new Cadence.NET.Attributes.NotificationBehavior.NotifyMethod[] 
    {
        Cadence.NET.Attributes.NotificationBehavior.NotifyMethod.Pushover
    })]
public class SampleTask : Task
{
    // Implementation
}

You will need to update your TaskContext for the task to set the messages you'd like to use. Cadence will automatically add the date, time, and run duration to all messages. You only need to provide contextual messages for the start and complete messages.

Finally, you will need to add the following keys in your web or app.config file for Pushover or SMTP (respectively).

<!-- Unique app key of your application -->
<add key="PushoverAppKey" value=""/>
<!-- Keys are a comma separated list of users -->
<add key="PushoverUserTokens" value=""/>

<!-- Email Notification Configuration -->

<add key="SMTPServer" value="smtp.google.com"/>
<add key="SMTPPort" value="587"/>
<add key="SMTPNotificationSubjectLine" value="Cadence Event Notification"/>
<!-- Addresses are a comma separated list of users -->
<add key="SMTPToAddresses" value="person1@email.com,person2@email.com"/>
<add key="SMTPFromAddress" value="from@email.com"/>
<add key="SMTPAuthUsername" value="LOGIN"/>
<add key="SMTPAuthPassword" value="PASSWORD"/>
That's it!

Last edited Sep 20, 2013 at 3:10 PM by Usualdosage, version 1