Esempio n. 1
0
        private void ProcessEvent(EventRow evt, Dictionary<string,string> customParams)
        {
            MailEvent mailEvent;
            switch(evt.@event)
            {
                case "processed":
                    mailEvent = new MailProcessedEvent(evt.email, evt.category);
                    break;
                case "deferred":
                    mailEvent = new MailDeferredEvent(evt.email, evt.response, evt.attempt.Value, evt.category);
                    break;
                case "delivered":
                    mailEvent = new MailDeliveredEvent(evt.email, evt.response, evt.category);
                    break;
                case "open":
                    mailEvent = new MailOpenedEvent(evt.email, evt.category);
                    break;
                case "click":
                    mailEvent = new MailClickedEvent(evt.email, evt.url, evt.category);
                    break;
                case "bounce":
                    mailEvent = new MailBounceEvent(evt.email, evt.status, evt.reason, evt.type, evt.category);
                    break;
                case "drop":
                    mailEvent = new MailDroppedEvent(evt.email, evt.reason, evt.category);
                    break;
                case "spam":
                    mailEvent = new MailReportedSpamEvent(evt.email, evt.category);
                    break;
                case "unsubscribe":
                    mailEvent = new MailUnsubscribedEvent(evt.email, evt.category);
                    break;
                default:
                    MailingEngine.EventHooksInternal.FireParseEventError(evt);
                    throw new ArgumentException("UnrecognizedEvent: " + evt.@event);
            }

            mailEvent.CustomParams = customParams;
            MailingEngine.EventHooksInternal.FireMailEvent(mailEvent);
        }
Esempio n. 2
0
 public void ProcessEvent(EventRow row)
 {
     var req = Request;
     var custom = req.Params.AllKeys.Where(k => !_eventParameters.Contains(k)).ToDictionary(k => k, k => req.Params[k]);
     ProcessEvent(row, custom);
 }