Пример #1
0
        public bool SendEmail_UserActionNeededReminder()
        {
            try
            {
                EmailBodyHelper objEmailBodyHelper = new EmailBodyHelper();

                string strEmailBody;
                if (objEmailBodyHelper.GetEmailBody_HTML(EmailTemplates.EmailTemplate_UserActionNeededReminder, out strEmailBody, DateTime.Now) == false)
                {
                    _lstErrorMessages.AddRange(objEmailBodyHelper.ErrorMessages);
                    throw new Exception("There was an error while trying to create the email body");
                }

                SMTPEmailUtility objSMTPEmailUtility = new SMTPEmailUtility();
                if (objSMTPEmailUtility.SendEmail("Address Management Reminder:  Failed or Abandoned Transactions", strEmailBody, ConfigHelper.GetSystemNotificationEmailRecipientList(), true))
                {
                    // Log the successful send
                }
                else
                {
                    _lstErrorMessages.AddRange(objSMTPEmailUtility.ErrorMessages);
                }
            }
            catch (Exception ex)
            {
                _lstErrorMessages.Add(ex.Message);
            }


            return(_lstErrorMessages.Count == 0);
        }
Пример #2
0
        public bool SendEmail_Stats()
        {
            try
            {
                EmailBodyHelper objEmailBodyHelper = new EmailBodyHelper();

                string strEmailBody;
                if (objEmailBodyHelper.GetEmailBody_HTML(EmailTemplates.EmailTemplate_Stats, out strEmailBody, DateTime.Now.AddDays(-1)) == false)
                {
                    _lstErrorMessages.AddRange(objEmailBodyHelper.ErrorMessages);
                    throw new Exception("There was an error while trying to create the email body");
                }

                SMTPEmailUtility objSMTPEmailUtility = new SMTPEmailUtility();
                if (objSMTPEmailUtility.SendEmail("Address Management : System STATs", strEmailBody, ConfigHelper.GetStatsEmailRecipientList(), true))
                {
                    // Log the successful send
                }
                else
                {
                    _lstErrorMessages.AddRange(objSMTPEmailUtility.ErrorMessages);
                }
            }
            catch (Exception ex)
            {
                _lstErrorMessages.Add(ex.Message);
            }


            return(_lstErrorMessages.Count == 0);
        }