public EmailSender(IParticipant participant, EmailTemplateBlock emailTemplate) { CurrentEvent = EPiServer.DataFactory.Instance.Get<EventPageBase>(participant.EventPage); CurrentParticipant = participant; Email = EmailTemplate.Load(emailTemplate, CurrentEvent, CurrentParticipant); }
public EmailSender(EventPageBase EventPageBase, EmailTemplateBlock emailTemplate) { CurrentEvent = EventPageBase; CurrentParticipant = null; Email = EmailTemplate.Load(emailTemplate, CurrentEvent, null); }
public EmailSender(IParticipant participant, EmailTemplateBlock emailTemplate) { CurrentEvent = EPiServer.DataFactory.Instance.Get <EventPageBase>(participant.EventPage); CurrentParticipant = participant; Email = EmailTemplate.Load(emailTemplate, CurrentEvent, CurrentParticipant); }
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; }