EmailTemplate PrepareEmailForEventOrganizer(EventRegistrationResult result, IEventRegistrationCommand command, Action <IGraffitiEmailContext> alterations) { IGraffitiEmailContext context = _emailContext; context.Put("request", HttpContext.Current.Request); context.Put("events", new EventMacros()); context.Put("name", HttpUtility.HtmlEncode(command.Name)); context.Put("attendeeEMail", HttpUtility.HtmlEncode(command.AttendeeEmail)); context.Put("event", result.Post); context.Put("isCcToAttendee", false); context.Put("isOnWaitingList", result.OnWaitingList); context.Put("isAlreadyRegistered", result.AlreadyRegistered); if (alterations != null) { alterations(context); } return(new EmailTemplate { Subject = _repository.Configuration.RegistrationMailSubject, Context = context.ToEmailTemplateToolboxContext(), TemplateName = _registrationEmailTemplate, From = null, To = result.Post[_repository.Configuration.RegistrationRecipientField] }); }
public EventRegistrationService(ICategorizedPostRepository <IEventPluginConfigurationProvider> repository, IGraffitiEmailContext emailContext, IEmailSender emailSender, string registrationEmailTemplate, IClock clock) { _repository = repository; _emailContext = emailContext; _emailSender = emailSender; _registrationEmailTemplate = registrationEmailTemplate; _clock = clock; }
public EventRegistrationService(ICategorizedPostRepository<IEventPluginConfigurationProvider> repository, IGraffitiEmailContext emailContext, IEmailSender emailSender, string registrationEmailTemplate, IClock clock) { _repository = repository; _emailContext = emailContext; _emailSender = emailSender; _registrationEmailTemplate = registrationEmailTemplate; _clock = clock; }