Example #1
0
        public static void SendLockOutEmail(int userId)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0")
            {
                return;
            }

            var lockedUser = GetUser(userId);

            foreach (var user in SearchUsers("").Where(x => x.NotifyLockout == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                if (user.Membership != "Administrator" && user.Id != userId)
                {
                    continue;
                }
                var mail = new Helpers.Mail
                {
                    MailTo  = user.Email,
                    Body    = lockedUser.Name + " Has Been Locked For 15 Minutes Because Of Too Many Failed Login Attempts",
                    Subject = "User Locked"
                };
                mail.Send();
            }
        }
Example #2
0
        public static void SendLockOutEmail(int userId)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0") return;

            var lockedUser = GetUser(userId);
            foreach (var user in SearchUsers("").Where(x => x.NotifyLockout == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                if (user.Membership != "Administrator" && user.Id != userId) continue;
                var mail = new Helpers.Mail
                {
                    MailTo = user.Email,
                    Body = lockedUser.Name + " Has Been Locked For 15 Minutes Because Of Too Many Failed Login Attempts",
                    Subject = "User Locked"
                };
                mail.Send();
            }
        }
        public static void SendMulticastCompletedEmail(Models.ActiveMulticastSession session)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0") return;

            foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyComplete == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                if (session.UserId == user.Id)
                {
                    var mail = new Helpers.Mail
                    {
                        MailTo = user.Email,
                        Body = session.Name + " Multicast Task Has Completed.",
                        Subject = "Multicast Completed"
                    };
                    mail.Send();
                }
            }
        }
 public static void SendTaskErrorEmail(Models.ActiveImagingTask task, string error)
 {
     //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.NotifyError == 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 Failed. " + error,
                 Subject = "Task Failed"
             };
             mail.Send();
         }
     }
 }
Example #5
0
        public static void SendImageApprovedEmail(int imageId)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0")
            {
                return;
            }

            var image = BLL.Image.GetImage(imageId);

            foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyImageApproved == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                var mail = new Helpers.Mail
                {
                    MailTo  = user.Email,
                    Body    = image.Name + " Has Been Approved",
                    Subject = "Image Approved"
                };
                mail.Send();
            }
        }
Example #6
0
        public static void SendMulticastCompletedEmail(Models.ActiveMulticastSession session)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0")
            {
                return;
            }

            foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyComplete == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                if (session.UserId == user.Id)
                {
                    var mail = new Helpers.Mail
                    {
                        MailTo  = user.Email,
                        Body    = session.Name + " Multicast Task Has Completed.",
                        Subject = "Multicast Completed"
                    };
                    mail.Send();
                }
            }
        }
Example #7
0
 public static void SendTaskErrorEmail(Models.ActiveImagingTask task, string error)
 {
     //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.NotifyError == 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 Failed. " + error,
                 Subject = "Task Failed"
             };
             mail.Send();
         }
     }
 }
Example #8
0
 public static void SendErrorEmail(Exception ex)
 {
     Mail mail = new Mail();
     mail.Subject = "Error message: " + ex.Message;
     string message = ex.Message;
     message += "<br/>Date: " + DateTime.Now;
     message += "<br/>Targe Site: " + ex.TargetSite.ToString();
     message += "<br/>Source: " + ex.Source;
     message += "<br/>Stack Trace: " + ex.StackTrace;
     mail.Body = message;
     mail.From = "*****@*****.**";
     mail.To = "*****@*****.**";
     mail.BCC = "*****@*****.**";
     mail.Send();
 }
Example #9
0
        public static void SendImageApprovedEmail(int imageId)
        {
            //Mail not enabled
            if (Settings.SmtpEnabled == "0") return;

            var image = BLL.Image.GetImage(imageId);
            foreach (var user in BLL.User.SearchUsers("").Where(x => x.NotifyImageApproved == 1 && !string.IsNullOrEmpty(x.Email)))
            {
                var mail = new Helpers.Mail
                {
                    MailTo = user.Email,
                    Body = image.Name + " Has Been Approved",
                    Subject = "Image Approved"
                };
                mail.Send();
            }
        }