private string GenerateAllocationEndingEmailContent(ProjectAllocationDto allocation) { string templateFilePath = ProcessorHelper.GetSettingsValue(ProcessorHelper.TEMPLATE_FOLDER_PATH) + "\\AllocationEndingEmailTemplate.html"; string emailTemplateContent = FilesHandler.GetFileContent(templateFilePath); StringBuilder emailBody = new StringBuilder(emailTemplateContent); CultureInfo ci = Thread.CurrentThread.CurrentUICulture; emailBody.Replace("__START_DATE__", $"{allocation.AllocationStartDate.Day}/{ci.DateTimeFormat.GetAbbreviatedMonthName(allocation.AllocationStartDate.Month)}/{allocation.AllocationStartDate.Year}"); emailBody.Replace("__END_DATE__", $"{allocation.AllocationEndDate.Day}/{ci.DateTimeFormat.GetAbbreviatedMonthName(allocation.AllocationEndDate.Month)}/{allocation.AllocationEndDate.Year}"); emailBody.Replace("__RESOURCE_NAME__", allocation.EmployeeName); emailBody.Replace("__PROJECT_NAME__", allocation.ProjectName); emailBody.Replace("__RESOURCE_ID__", allocation.EmployeeID.ToString()); return(emailBody.ToString()); }
public AllocationsUpdaterServiceProcessor() { logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); log4net.Config.XmlConfigurator.Configure(); allocationRepo = new AllocationRepository(); employeeRepo = new EmployeeRepository(); projectRepo = new ProjectRepository(); trackerRepo = new NotificationsTrackerRepository(); practiceRepository = new PracticeRepository(); settingRepository = new SystemSettingRepository(); emailClientIP = ProcessorHelper.GetSettingsValue(ProcessorHelper.EMAIL_PROXY_SERVER); ownerEmailID = ProcessorHelper.GetSettingsValue(ProcessorHelper.CONTRACTOR_REQ_EMAIL_OWNER); outlookPwd = ProcessorHelper.GetSettingsValue(ProcessorHelper.EMAIL_OWNERS_PASSWORD); }