Ejemplo n.º 1
0
        public static List <ScheduledEmailBlock> GetScheduledEmailsToSend(List <EventPageBase> eventPages)
        {
            List <ScheduledEmailBlock> emailsToSend = new List <ScheduledEmailBlock>();

            foreach (EventPageBase eventPageBase in eventPages)
            {
                foreach (ScheduledEmailBlock scheduledEmailBlock in AttendScheduledEmailEngine.GetScheduledEmailsToSend(eventPageBase))
                {
                    emailsToSend.Add(scheduledEmailBlock);
                }
            }
            return(emailsToSend);
        }
Ejemplo n.º 2
0
        public static string GetStatus(ScheduledEmailBlock scheduledEmailBlock)
        {
            if (scheduledEmailBlock.EmailSendOptions == SendOptions.Action)
            {
                return("<span class='label label-success'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/attendstatus/" + scheduledEmailBlock.SendOnStatus.ToString()) + "</span>");
            }
            if (scheduledEmailBlock.EventPage == null)
            {
                return(string.Empty);
            }
            DateTime sendDateTime = AttendScheduledEmailEngine.GetSendDate(scheduledEmailBlock,
                                                                           ServiceLocator.Current.GetInstance <IContentRepository>().Get <EventPageBase>(scheduledEmailBlock.EventPage));

            if (sendDateTime >
                DateTime.Now && ((int)sendDateTime.Subtract(DateTime.Now).TotalDays > 0))
            {
                return("<span class='label label-success'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/in") + " " + (int)sendDateTime.Subtract(DateTime.Now).TotalDays + " " + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/days") + "</span>");
            }
            if (sendDateTime >
                DateTime.Now && ((int)sendDateTime.Subtract(DateTime.Now).TotalHours > 0))
            {
                return("<span class='label label-success'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/in") + " " + (int)sendDateTime.Subtract(DateTime.Now).TotalHours + " " + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/hours") + "</span>");
            }
            if (sendDateTime >
                DateTime.Now && ((int)sendDateTime.Subtract(DateTime.Now).TotalHours <= 0))
            {
                return("<span class='label label-success'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/in") + " " + (int)sendDateTime.Subtract(DateTime.Now).TotalMinutes + " " + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/minutes") + "</span>");
            }
            if (DateTime.Now.Subtract(scheduledEmailBlock.DateSent).TotalDays > 60000)
            {
                return("<span class='label label-warning'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/sending") + "...</span>");
            }
            else
            {
                return("<span class='label label-primary'>" + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/sent") + " " + (int)DateTime.Now.Subtract(scheduledEmailBlock.DateSent).TotalDays + " " + EPiServer.Framework.Localization.LocalizationService.Current.GetString("/attend/admin/daysAgo") + "</span>");
            }
        }