示例#1
0
        /// <summary>
        /// Sends a formatted email to the development team
        /// </summary>
        /// <param name="e">The thrown exception.</param>
        /// <param name="bodyPrefix">The body prefix. will appear before the main text of the body</param>
        /// <param name="bodySuffix">The body suffix. will appear after the main text of the body</param>
        public void SendDevEmail(Exception e, string bodyPrefix = "", string bodySuffix = "")
        {
            Exception inner = null;

            if (e == null)
            {
                e = new Exception("General Alert");
            }
            else
            {
                inner = e.InnerException;
            }

            string[] subject = { MyTime.TodaysDateStrYYYYMMDD, e.GetType().ToString() };
            string[] body    = { e.GetType().ToString(), e.Message, e.StackTrace ?? " null ", (inner != null ? inner.Message : " null "), (inner != null ? inner.StackTrace : " null ") };

            IEmailJob emailJob = XmlSettings.Instance.WbEmail.GetJob(EmailJobTypes.SendDevNotice, "Alert", subject, body);

            if (!string.IsNullOrEmpty(bodyPrefix))
            {
                emailJob.AppendBodyPrefix(bodyPrefix);
            }
            if (!string.IsNullOrEmpty(bodySuffix))
            {
                emailJob.AppendBodySuffix(bodySuffix);
            }

            var outbound = new OutboundEmail(emailJob);
        }
示例#2
0
 public OutboundEmail(IEmailJob emailJob)
 {
     if (!XmlSettings.Instance.WbEmail.IsActive)
     {
         GatLogger.Instance.AddMessage(string.Format("Email Job [{0}] was halted.  Email System Inactive", emailJob.JobName), LogMode.LogAndScreen);
         GatLogger.Instance.AddMessage(emailJob.Body);
         return;
     }
     _Init();
     EmailFile(emailJob);
 }
示例#3
0
        /// <summary>
        /// Sends a formatted email to the compliance mailing list.
        /// </summary>
        /// <param name="noticeTitle">The notice title.</param>
        /// <param name="mainText">The main text of the email.</param>
        /// <param name="bodyPrefix">The body prefix. will appear before the main text of the body</param>
        /// <param name="bodySuffix">The body suffix. will appear after the main text of the body</param>
        public void SendComplianceEmail(string noticeTitle, string mainText, string bodyPrefix = "", string bodySuffix = "")
        {
            string[] subject = { MyTime.TodaysDateStrYYYYMMDD, noticeTitle };
            string[] body    = { mainText };

            IEmailJob emailJob = XmlSettings.Instance.WbEmail.GetJob(EmailJobTypes.SendComplianceNotice, "Alert", subject, body);

            if (!string.IsNullOrEmpty(bodyPrefix))
            {
                emailJob.AppendBodyPrefix(bodyPrefix);
            }
            if (!string.IsNullOrEmpty(bodySuffix))
            {
                emailJob.AppendBodySuffix(bodySuffix);
            }

            var outbound = new OutboundEmail(emailJob);
        }
示例#4
0
 public void EmailFile(IEmailJob emailJob)
 {
     EmailFile(emailJob.JobName, emailJob.Subject, emailJob.Body, emailJob.Recipients, emailJob.AttachmentFilepath);
 }
示例#5
0
 public OutboundEmail(IEmailJob emailJob)
     : this()
 {
     EmailFile(emailJob);
 }