Example #1
0
        public IHttpActionResult GenerateSpam(Guid contactId, Guid messageId, string email, string date)
        {
            var dateTime = this.TryParseDate(date);

            var eventData = new SerializationCollection();

            eventData.Set("MessageId", messageId);
            eventData.Set("FakeDateTime", dateTime.ToString("u"));

            var pipelineArgs = new HandleSpamComplaintPipelineArgs(contactId.ToID(), messageId.ToID(), messageId.ToID(), email, eventData);

            new PipelineHelper().RunPipeline(Sitecore.EmailCampaign.Cm.Constants.HandleSpamComplaintPipeline, pipelineArgs);

            return(this.Ok());
        }
Example #2
0
        public IHttpActionResult GenerateSpam(Guid contactId, Guid messageId, string date)
        {
            var dateTime  = TryParseDate(date);
            var contact   = _contactService.GetContact(contactId.ToID());
            var eventData = new EventData(contact.Identifiers.FirstOrDefault(x => x.Source.Equals("ExperienceGenerator")), new SpamComplaintEvent(dateTime)
            {
                MessageId  = messageId,
                InstanceId = messageId
            });

            var pipelineArgs = new HandleSpamComplaintPipelineArgs(eventData);

            new PipelineHelper().RunPipeline(Constants.HandleSpamComplaintPipeline, pipelineArgs);

            return(Ok());
        }