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;
 }
Example #2
0
        public string GetContentForAnyWebinarEmail(WebinarAllEmailTagsBO objAllEmailTags, string ContentInfo, bool isContentFromTemplate, string emailType, string dtFormat = "")
        {
            string fileContent = "";
            if (isContentFromTemplate)
            {
                if (File.Exists(ContentInfo))
                    fileContent = File.ReadAllText(ContentInfo);
            }
            else
                fileContent = ContentInfo;

            switch (emailType)
            {
                case "Attendee Followup":
                    fileContent = fileContent.Replace("##FIRSTNAME##", objAllEmailTags.RegistrantFirstName);
                    fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    fileContent = fileContent.Replace("##USEREMAILADDRESS##", objAllEmailTags.UserEmail);
                    fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + objAllEmailTags.AudienceURL + "'>" + objAllEmailTags.AudienceURL + "</a>");
                    break;
                case "Confirmation Email":
                    fileContent = fileContent.Replace("##FIRSTNAME##", objAllEmailTags.RegistrantFirstName);
                    fileContent = fileContent.Replace("##EVENTDATE##", Convert.ToDateTime(objAllEmailTags.EventDate).ToString(dtFormat.Replace("MM", "MMM")));
                    fileContent = fileContent.Replace("##EVENTTIME##", Convert.ToDateTime(objAllEmailTags.EventTime).ToString("h:mm tt"));
                    //fileContent = fileContent.Replace("##REGISTRANTID##", objAllEmailTags.RegistrantID.ToString());
                    fileContent = fileContent.Replace("##EVENTTIMEZONESHORT##", objAllEmailTags.TimeZoneName);
                    // fileContent = fileContent.Replace("##WEBINARID##", objAllEmailTags.WebinarID.ToString());
                    fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + objAllEmailTags.AudienceURL + "'>" + objAllEmailTags.AudienceURL + "</a>");
                    break;
                case "Email a Friend":
                    break;
                case "Non-Attendee Followup":
                    fileContent = fileContent.Replace("##FIRSTNAME##", objAllEmailTags.RegistrantFirstName);
                    fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + objAllEmailTags.AudienceURL + "'>" + objAllEmailTags.AudienceURL + "</a>");
                    break;
                case "Registrant Reminder Email":
                    TimeSpan diff = Convert.ToDateTime(objAllEmailTags.EventDate) - DateTime.Now;
                    Int32 days = diff.Days;
                    string timeduration = "";
                    if (days > 0)
                        timeduration = days.ToString() + " days";
                    else
                    {
                        if (diff.Hours < 2)
                            timeduration = "an hour";
                        else
                            timeduration = (diff.Hours).ToString() + " hours";
                    }
                    fileContent = fileContent.Replace("##FIRSTNAME##", objAllEmailTags.RegistrantFirstName);
                    fileContent = fileContent.Replace("##TIMETOSTART##", timeduration);
                    //fileContent = fileContent.Replace("##EVENTDATE##", objAllEmailTags.EventDate);
                    //fileContent = fileContent.Replace("##EVENTTIME##", objAllEmailTags.EventTime);
                    //fileContent = fileContent.Replace("##REGISTRANTID##", objAllEmailTags.RegistrantID.ToString());
                    //fileContent = fileContent.Replace("##TIMEZONE##", objAllEmailTags.TimeZoneName);
                    //fileContent = fileContent.Replace("##WEBINARID##", objAllEmailTags.WebinarID.ToString());
                    fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    //fileContent = fileContent.Replace("##REMINDERDAYS##", objAllEmailTags.RemainingDays);
                    //fileContent = fileContent.Replace("##CALENDARREMINDER##", objAllEmailTags.CalenderReminder);
                    fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + objAllEmailTags.AudienceURL + "'>" + objAllEmailTags.AudienceURL + "</a>");
                    //fileContent = fileContent.Replace("##REGEMAIL##", objAllEmailTags.RegistrantEmail);
                    //fileContent = fileContent.Replace("##EVENTTIMEZONESHORT##", objAllEmailTags.TimeZoneName);

                    break;
                case "Webinar Invitation":
                      fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    fileContent = fileContent.Replace("##EVENTDATE##", Convert.ToDateTime(objAllEmailTags.EventDate).ToString(dtFormat.Replace("MM", "MMM")));
                    fileContent = fileContent.Replace("##EVENTTIME##", Convert.ToDateTime(objAllEmailTags.EventTime).ToString("h:mm tt"));
                    fileContent = fileContent.Replace("##EVENTENDTIME##", Convert.ToDateTime(objAllEmailTags.EndTime).ToString("h:mm tt"));
                    fileContent = fileContent.Replace("##REGI_URL##", "<a href='" + objAllEmailTags.RegistrationURL + "'>" + objAllEmailTags.RegistrationURL + "</a>");
                    fileContent = fileContent.Replace("##WEBINARSUMMARY##", objAllEmailTags.Description);
                    fileContent = fileContent.Replace("##EVENTTIMEZONESHORT##", objAllEmailTags.TimeZoneName);
                    fileContent = fileContent.Replace("##USEREMAILADDRESS##", objAllEmailTags.UserEmail);
                    fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + objAllEmailTags.AudienceURL + "'>" + objAllEmailTags.AudienceURL + "</a>");
                    break;
                case "Webinar Cancellation":
                    fileContent = fileContent.Replace("##EVENTTITLE##", objAllEmailTags.WebinarTitle);
                    fileContent = fileContent.Replace("##EVENTDATE##", Convert.ToDateTime(objAllEmailTags.EventDate).ToString(dtFormat.Replace("MM", "MMM")));
                    fileContent = fileContent.Replace("##EVENTTIME##", Convert.ToDateTime(objAllEmailTags.EventTime).ToString("h:mm tt"));
                    fileContent = fileContent.Replace("##FIRSTNAME##", objAllEmailTags.RegistrantFirstName);
                    break;
            }

            return fileContent;
        }
Example #3
0
        public string getSystemRequirement(string audiurl = "")
        {
            WebinarAllEmailTagsBO WebInvSysReq = new WebinarAllEmailTagsBO();
            if (audiurl == null) audiurl = "";
            string tplFile;
            if (audiurl != "")
                tplFile = EnumUtils.stringValueOf(ReportTemplates.WebinarInviteSysReq);
            else
                tplFile = EnumUtils.stringValueOf(ReportTemplates.SystemReq);

            if (File.Exists(Constant.DocTemplate + tplFile))
            {
                string fileContent = File.ReadAllText(Constant.DocTemplate + tplFile);
                fileContent = fileContent.Replace("##AUDI_URL##", "<a href='" + audiurl + "'>" + audiurl + "</a>");
                return fileContent;
            }
            else
                return "";
        }
Example #4
0
        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;
        }