Created
July 7, 2016 21:09
-
-
Save casper-rasmussen/20b032036f835415cf894b5c2248f414 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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