private void NotifyAdminAccountCreation(AdminBO AdminBO, OrganizationBO Organization) { string NotifyAdmin = ConfigurationManager.AppSettings["NOTIFY_ADMIN_IS_ENABLED"]; string AdminEmail = ConfigurationManager.AppSettings["NOTIFY_ADMIN_EMAIL"]; string strOrgKeyDecrypted = Epi.Web.Common.Security.Cryptography.Decrypt(Organization.OrganizationKey.ToString()); // List<AdminBO> AdminBOList = new List<AdminBO>(); List <string> AdminList = new List <string>(); if (NotifyAdmin.ToUpper() == "TRUE") { AdminList.Add(AdminEmail); } //AdminBOList = GetOrganizationAdmins(SurveyInfo); //foreach (var item in AdminBOList) // { // AdminList.Add(item.AdminEmail); // } Epi.Web.Common.Email.Email Email = new Web.Common.Email.Email(); Email.Body = "Organization Name:" + Organization.Organization + "\nOrganization Key: " + strOrgKeyDecrypted + "\nAdmin Email: " + AdminBO.AdminEmail + "\n\nThank you."; Email.From = ConfigurationManager.AppSettings["EMAIL_FROM"]; Email.To = AdminList; Email.Subject = "An organization account has been created."; if (AdminList.Count() > 0) { bool success = Epi.Web.Common.Email.EmailHandler.SendMessage(Email); } }
public void SendEmailToAdmins(SurveyInfoBO SurveyInfo) { List <AdminBO> AdminBOList = new List <AdminBO>(); List <string> AdminList = new List <string>(); AdminBOList = GetOrganizationAdmins(SurveyInfo); foreach (var item in AdminBOList) { AdminList.Add(item.AdminEmail); } Epi.Web.Common.Email.Email Email = new Web.Common.Email.Email(); Email.Body = "The following survey has been promoted to FINAL mode:\n Title:" + SurveyInfo.SurveyName + " \n Survey ID:" + SurveyInfo.SurveyId + " \nOrganization:" + SurveyInfo.OrganizationName + "\n Start Date & Time:" + SurveyInfo.StartDate + "\n Closing Date & Time:" + SurveyInfo.ClosingDate + " \n \n \n Thank you."; Email.From = ConfigurationManager.AppSettings["EMAIL_FROM"]; Email.To = AdminList; Email.Subject = "Survey -" + SurveyInfo.SurveyName + " has been promoted to FINAL"; bool success = Epi.Web.Common.Email.EmailHandler.SendMessage(Email); }
private void EmailApplicant(AdminBO AdminBO, OrganizationBO Organization) { string AdminEmail = ConfigurationManager.AppSettings["SYSTEM_ADMIN_EMAIL"]; string ApplicantValidation = ConfigurationManager.AppSettings["APPLICANT_VALIDATION_IS_ENABLED"]; List <string> AdminList = new List <string>(); string strOrgKeyDecrypted = Epi.Web.Common.Security.Cryptography.Decrypt(Organization.OrganizationKey.ToString()); if (ApplicantValidation.ToUpper() == "FALSE") { AdminList.Add(AdminBO.AdminEmail); } StringBuilder Body = new StringBuilder(); Body.Append("Organization Name:" + Organization.Organization + "\nOrganization Key: " + strOrgKeyDecrypted); Body.Append("\n\nPlease follow the steps below in order to start publishing forms to the web."); Body.Append("\n\tStep 1:Download and install the latest version of Epi Info™ 7 from:" + ConfigurationManager.AppSettings["EPI_INFO_DOWNLOAD_URL"]); Body.Append("\n\tStep 2:On the Main Menu, click on “Tools” and select “Options”"); Body.Append("\n\tStep 3:On the Options dialog, click on the “Web Survey” Tab."); Body.Append("\n\tStep 4:On the Web Survey tab, enter the following information."); Body.Append("\n\t\t-Endpoint Address:" + ConfigurationManager.AppSettings["ENDPOINT_ADDRESS"] + "\n\t\t-Connect using Windows Authentication: " + ConfigurationManager.AppSettings["WINDOW_AUTHENTICATION"]); Body.Append("\n\t\t-Binding Protocol:" + ConfigurationManager.AppSettings["BINDING_PROTOCOL"]); Body.Append("\n\tStep 5:Click “OK’ button."); Body.Append("\n\tOrganization key provided here is to be used in Epi Info™ 7 during publish process."); Body.Append("\n\nPlease contact the system administrator " + AdminEmail + " for any questions."); Body.Append("\n\nThank you."); Epi.Web.Common.Email.Email Email = new Web.Common.Email.Email(); Email.Body = Body.ToString(); Email.From = ConfigurationManager.AppSettings["EMAIL_FROM"]; Email.To = AdminList; Email.Subject = "An account for your organization has been created. Please refer to details below."; if (AdminList.Count() > 0) { bool success = Epi.Web.Common.Email.EmailHandler.SendMessage(Email); } }