public string getFormedEmailContent(string contentWithTags, string emailType, int webinarID, string dateformat = "") { string rtn = ""; WebinarAllEmailTagsBO objTpl = new WebinarAllEmailTagsBO(); ReportDA objRpt = new ReportDA(); List<GeneralWebinarTagsBO> objTags = new List<GeneralWebinarTagsBO>(); objTags = objRpt.getGeneralWebinarTagValues(webinarID); switch (emailType) { case "Attendee Followup": if (objTags.Count > 0) { objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.AudienceURL = objTags[0].WebinarURLList.AudienceInterfaceURL; objTpl.UserEmail = objTags[0].UserEmail; if (objTags[0].Registrantlist.Fld1 == null) objTpl.RegistrantFirstName = "Registrant Name"; else if (objTags[0].Registrantlist.Fld1.Trim() == "") objTpl.RegistrantFirstName = "Registrant Name"; else objTpl.RegistrantFirstName = objTags[0].Registrantlist.Fld1; } break; case "Confirmation Email": if (objTags.Count > 0) { objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.EventDate = objTags[0].WebinarList.StartDate.ToString(dateformat.Replace("MM", "MMM")); objTpl.EventTime = Convert.ToDateTime(objTags[0].WebinarList.StartTime).ToString("h:mm tt"); objTpl.AudienceURL = objTags[0].WebinarURLList.AudienceInterfaceURL; if (objTags[0].Registrantlist.Fld1 == null) objTpl.RegistrantFirstName = "Registrant Name"; else if (objTags[0].Registrantlist.Fld1.Trim() == "") objTpl.RegistrantFirstName = "Registrant Name"; else objTpl.RegistrantFirstName = objTags[0].Registrantlist.Fld1; } break; case "Non-Attendee Followup": if (objTags.Count > 0) { objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.AudienceURL = objTags[0].WebinarURLList.AudienceInterfaceURL; if (objTags[0].Registrantlist.Fld1 == null) objTpl.RegistrantFirstName = "Registrant Name"; else if (objTags[0].Registrantlist.Fld1.Trim() == "") objTpl.RegistrantFirstName = "Registrant Name"; else objTpl.RegistrantFirstName = objTags[0].Registrantlist.Fld1; } break; case "Registrant Reminder Email": if (objTags.Count > 0) { objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.EventDate = objTags[0].WebinarList.StartDate.ToString(dateformat.Replace("MM", "MMM")); objTpl.EventTime = Convert.ToDateTime(objTags[0].WebinarList.StartTime).ToString("h:mm tt"); objTpl.AudienceURL = objTags[0].WebinarURLList.AudienceInterfaceURL; objTpl.TimeZoneName = objTags[0].TimeZoneName; objTpl.WebinarID = objTags[0].WebinarList.WebinarID; objTpl.RemainingDays = ""; if (objTags[0].Registrantlist.Fld1 == null) objTpl.RegistrantFirstName = "Registrant Name"; else if (objTags[0].Registrantlist.Fld1.Trim() == "") objTpl.RegistrantFirstName = "Registrant Name"; else objTpl.RegistrantFirstName = objTags[0].Registrantlist.Fld1; } break; case "Webinar Invitation": if (objTags.Count > 0) { objTpl.RegistrationURL = objTags[0].WebinarURLList.RegistrationURL; objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.EventDate = objTags[0].WebinarList.StartDate.ToString(dateformat.Replace("MM", "MMM")); objTpl.EventTime = Convert.ToDateTime(objTags[0].WebinarList.StartTime).ToString("h:mm tt"); objTpl.Description = objTags[0].WebinarList.Description; objTpl.EndTime = Convert.ToDateTime(objTags[0].WebinarList.EndTime).ToString("h:mm tt"); objTpl.TimeZoneName = objTags[0].TimeZoneShortName; AudiUrl = objTags[0].WebinarURLList.AudienceInterfaceURL; } rtn = contentWithTags; break; case "Webinar Cancellation": if (objTags.Count > 0) { objTpl.WebinarTitle = objTags[0].WebinarList.Title; objTpl.EventTime = Convert.ToDateTime(objTags[0].WebinarList.StartTime).ToString("h:mm tt"); objTpl.EventDate = objTags[0].WebinarList.StartDate.ToString(dateformat.Replace("MM", "MMM")); if (objTags[0].Registrantlist.Fld1 == null) objTpl.RegistrantFirstName = "Registrant Name"; else if (objTags[0].Registrantlist.Fld1.Trim() == "") objTpl.RegistrantFirstName = "Registrant Name"; else objTpl.RegistrantFirstName = objTags[0].Registrantlist.Fld1; } break; } EBird.Framework.TemplateMgmt objTemplate = new EBird.Framework.TemplateMgmt(); rtn = objTemplate.GetContentForAnyWebinarEmail(objTpl, contentWithTags, false, emailType, dateformat); return rtn; }
private string getFormedEmailContent(string contentWithTags, string emailType, int webinarID) { string rtn = ""; WebinarAllEmailTagsBO objTpl = new WebinarAllEmailTagsBO(); switch (emailType) { case "Attendee Followup": rtn = contentWithTags; break; case "Confirmation Email": rtn = contentWithTags; break; case "Non-Attendee Followup": rtn = contentWithTags; break; case "Registrant Reminder Email": List<WebinarBE> objWebBE = objWebinarDA.GetWebinarDetailDA(webinarID); if (objWebBE.Count > 0) { MasterDA objMas = new MasterDA(); List<TimeZoneBE> tm = objMas.getTimeZoneName(objWebBE[0].TimeZoneID); objTpl.EventDate = objWebBE[0].StartDate.ToShortDateString(); objTpl.EventTime = objWebBE[0].StartTime; objTpl.TimeZoneName = tm[0].ShortTimeZoneName; objTpl.WebinarID = objWebBE[0].WebinarID; objTpl.WebinarTitle = objWebBE[0].Title; objTpl.AudienceURL = ""; objTpl.RemainingDays = ""; } break; case "Webinar Invitation": rtn = contentWithTags; break; } TemplateMgmt objTemplate = new TemplateMgmt(); rtn = objTemplate.GetContentForAnyWebinarEmail(objTpl, contentWithTags, false, emailType); return rtn; }