public static void SendTaskCompletedEmail(Models.ActiveImagingTask task)
{
//Mail not enabled
if (Settings.SmtpEnabled == "0") return;
task.Computer = BLL.Computer.GetComputer(task.ComputerId);
foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyComplete == 1 && !string.IsNullOrEmpty(x.Email)))
{
if (task.UserId == user.Id)
{
var mail = new Helpers.Mail
{
MailTo = user.Email,
Body = task.Computer.Name + " Image Task Has Completed.",
Subject = "Task Completed"
};
mail.Send();
}
}
}