Skip to content

Instantly share code, notes, and snippets.

@casper-rasmussen
Created July 7, 2016 21:09
Show Gist options
  • Save casper-rasmussen/20b032036f835415cf894b5c2248f414 to your computer and use it in GitHub Desktop.
Save casper-rasmussen/20b032036f835415cf894b5c2248f414 to your computer and use it in GitHub Desktop.
class JobNotificationManager : IJobNotificationManager
{
public bool TryGet(ScheduledJob job, bool success, string message, out INotification notification)
{
notification = default(INotification);
if (success)
return false;
notification = new Notification()
{
Subject = "Scheduled Job Failed",
Message = String.Format("{0}: {1}", job.Name, message),
Recipients = Roles.GetUsersInRole("NotificationUsers"),
Sender = "NotificationUser"
};
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment