Exemple #1
0
 public EmailSender(IParticipant participant, EmailTemplateBlock emailTemplate)
 {
     CurrentEvent = EPiServer.DataFactory.Instance.Get<EventPageBase>(participant.EventPage);
     CurrentParticipant = participant;
     Email = EmailTemplate.Load(emailTemplate, CurrentEvent, CurrentParticipant);
 }
Exemple #2
0
 public EmailSender(EventPageBase EventPageBase, EmailTemplateBlock emailTemplate)
 {
     CurrentEvent = EventPageBase;
     CurrentParticipant = null;
     Email = EmailTemplate.Load(emailTemplate, CurrentEvent, null);
 }
        public bool SendStatusMail(IParticipant participant, EmailTemplateBlock et)
        {
            EmailSender email;
            email = new EmailSender(participant, et);

            email.Send();

            return true;
        }
Exemple #4
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.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;
 }
        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);

        }