public void LiveCampaignTrackingGetSummaryTest() { var cc = new ConstantContact(ApiKey, AccessToken); var camp = new EmailCampaign { EmailContent = "<html><body>EMAIL CONTENT.</body></html>", Subject = "campaign subject", FromName = "my company", FromEmail = CustomerEmail, ReplyToEmail = CustomerEmail, Name = "campaign_" + DateTime.Now.ToString("yyMMddHHmmss"), TextContent = "email campaign text content", GreetingString = "Dear ", //TemplateType = TemplateType.CUSTOM, Status = CampaignStatus.DRAFT, EmailContentFormat = CampaignEmailFormat.HTML, StyleSheet = "", MessageFooter = new MessageFooter { OrganizationName = "my organization", AddressLine1 = "123 Mapple Street", AddressLine2 = "Suite 1", AddressLine3 = "", City = "Boston", State = "MA", PostalCode = "02101", Country = "US", IncludeForwardEmail = true, ForwardEmailLinkText = "forward link", IncludeSubscribeLink = true, SubscribeLinkText = "subscribe link" } , Lists = new List<SentContactList> { new SentContactList { Id = "1" } } }; camp = cc.AddCampaign(camp); Assert.IsNotNull(camp); Assert.IsNotNull(camp.Id); TrackingSummary summary = cc.GetCampaignTrackingSummary(camp.Id); Assert.IsNotNull(summary); }
public void LiveContactTrackingSummaryTest() { var cc = new ConstantContact(ApiKey, AccessToken); ResultSet<Contact> contacts = cc.GetContacts(DateTime.Now.AddMonths(-1)); Assert.IsNotNull(contacts); Assert.IsNotNull(contacts.Results); Assert.IsTrue(contacts.Results.Count > 0); TrackingSummary summary = cc.GetContactTrackingSummary(contacts.Results[0].Id); Assert.IsNotNull(summary); //Assert.AreNotEqual(0, summary.Forwards); //Assert.AreNotEqual(0, summary.Opens); //Assert.AreNotEqual(0, summary.Sends); IList<EmailCampaign> camps = cc.GetCampaigns(DateTime.Now.AddMonths(-1)); summary = cc.GetCampaignTrackingSummary(camps[1].Id); //Assert.AreNotEqual(0, summary.Forwards); //Assert.AreNotEqual(0, summary.Opens); //Assert.AreNotEqual(0, summary.Sends); //Assert.AreNotEqual(0, summary.Bounces); }