public void ProcessEvent(EventType type, EventData data) { if (type != EventType.ApplicationSetState) { throw new InvalidOperationException(type + " is not supported"); } }
public void ProcessEvent(EventType type, EventData data) { var messages = _messageBuilder.Get(type, data); if (messages != null) { _sender.Send(messages); } }
public EmailMessage[] Get(EventType type, EventData eventData) { var data = _serializer.Deserialize<EventDataForEntity>(eventData.Data); var templateId = _templates.GetTemplateId(type); if(!templateId.HasValue) { return null; } var recipients = _recipients.GetRecipients(type, data); if(recipients == null || recipients.Length == 0) { return null; } var languages = recipients.Select(x => x.Culture).Distinct().ToArray(); var files = _files.GetFiles(type, data, languages); return GetEmailMessages(templateId.Value, recipients, data, files, eventData.UserId, type).ToArray(); }