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" ( 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:

    NotifyOnTaskComplete = true, 
    NotifyOnTaskError = true, 
    NotifyOnTaskStart = true, 
    NotificationMethods = new Cadence.NET.Attributes.NotificationBehavior.NotifyMethod[] 
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=""/>
<add key="SMTPPort" value="587"/>
<add key="SMTPNotificationSubjectLine" value="Cadence Event Notification"/>
<!-- Addresses are a comma separated list of users -->
<add key="SMTPToAddresses" value=","/>
<add key="SMTPFromAddress" value=""/>
<add key="SMTPAuthUsername" value="LOGIN"/>
<add key="SMTPAuthPassword" value="PASSWORD"/>
That's it!

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