public bool SendStatusMail(IParticipant participant, EmailTemplateBlock et)
        {
            EmailSender email;

            email = new EmailSender(participant, et);

            email.Send();

            return(true);
        }
Beispiel #2
0
        public static EmailTemplate Load(EmailTemplateBlock template, EventPageBase EventPageBase, IParticipant participant)
        {
            EmailTemplate email = new EmailTemplate();

            email.HtmlBody    = PopulatePropertyValues(template.MainBody != null ? template.MainBody.ToString() : string.Empty, EventPageBase, participant);
            email.HtmlBody    = RewriteUrls(email.HtmlBody, GetSiteUrl(EventPageBase));
            email.Body        = PopulatePropertyValues(template.MainTextBody, EventPageBase, participant);
            email.To          = PopulatePropertyValues(template.To, EventPageBase, participant);
            email.From        = PopulatePropertyValues(template.From, EventPageBase, participant);
            email.Cc          = PopulatePropertyValues(template.CC, EventPageBase, participant);
            email.Bcc         = PopulatePropertyValues(template.BCC, EventPageBase, participant);
            email.Subject     = PopulatePropertyValues(template.Subject, EventPageBase, participant);
            email.Participant = participant;
            email.SendAsSms   = template.SendAsSms;
            return(email);
        }
Beispiel #3
0
        private void ConvertEmailTemplateToLocal(string sharedBlock, string localBlock)
        {
            EventPageBase      currentEventPageBase = CurrentPage.CreateWritableClone() as EventPageBase;
            EmailTemplateBlock sharedBlockData      = Get <EmailTemplateBlock>((CurrentPage as EventPageBase)[sharedBlock] as ContentReference) as EmailTemplateBlock;
            EmailTemplateBlock localBlockData       = currentEventPageBase[localBlock] as EmailTemplateBlock;

            localBlockData.BCC                = sharedBlockData.BCC;
            localBlockData.CC                 = sharedBlockData.CC;
            localBlockData.From               = sharedBlockData.From;
            localBlockData.MainBody           = sharedBlockData.MainBody;
            localBlockData.MainTextBody       = sharedBlockData.MainTextBody;
            localBlockData.Subject            = sharedBlockData.Subject;
            localBlockData.To                 = sharedBlockData.To;
            currentEventPageBase[sharedBlock] = null;
            Locate.ContentRepository().Save(currentEventPageBase, AttendScheduledEmailEngine.GetForcedSaveActionFor(currentEventPageBase));
            ClientScript.RegisterStartupScript(this.GetType(), "scriptid", "window.parent.location.href='" + EPiServer.Editor.PageEditing.GetEditUrl((CurrentData as IContent).ContentLink) + "'", true);
        }
        public static void CreateScheduledEmail(EventPageBase EventPageBase, AttendStatus status, EmailTemplateBlock emailTemplate, ContentReference emailTemplateContentReference, string name)
        {
            ScheduledEmailBlock emailBlock =
                API.AttendScheduledEmailEngine.GenerateScheduledEmailBlock(EventPageBase.ContentLink).CreateWritableClone() as ScheduledEmailBlock;

            emailBlock.EmailSendOptions           = SendOptions.Action;
            emailBlock.SendOnStatus               = status;
            emailBlock.EmailTemplate.BCC          = emailTemplate.BCC;
            emailBlock.EmailTemplate.CC           = emailTemplate.CC;
            emailBlock.EmailTemplate.From         = emailTemplate.From;
            emailBlock.EmailTemplate.To           = emailTemplate.To;
            emailBlock.EmailTemplate.Subject      = emailTemplate.Subject;
            emailBlock.EmailTemplate.MainBody     = emailTemplate.MainBody;
            emailBlock.EmailTemplate.MainTextBody = emailTemplate.MainTextBody;

            emailBlock.EmailTemplateContentReference = emailTemplateContentReference;

            (emailBlock as IContent).Name = name;

            DataFactory.Instance.Save(emailBlock as IContent, SaveAction.Publish);
        }
Beispiel #5
0
 public EmailSender(IParticipant participant, EmailTemplateBlock emailTemplate)
 {
     CurrentEvent       = EPiServer.DataFactory.Instance.Get <EventPageBase>(participant.EventPage);
     CurrentParticipant = participant;
     Email = EmailTemplate.Load(emailTemplate, CurrentEvent, CurrentParticipant);
 }
Beispiel #6
0
 public EmailSender(EventPageBase EventPageBase, EmailTemplateBlock emailTemplate)
 {
     CurrentEvent       = EventPageBase;
     CurrentParticipant = null;
     Email = EmailTemplate.Load(emailTemplate, CurrentEvent, null);
 }