本文整理汇总了C#中CTCT.ConstantContact类的典型用法代码示例。如果您正苦于以下问题:C# ConstantContact类的具体用法?C# ConstantContact怎么用?C# ConstantContact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConstantContact类属于CTCT命名空间,在下文中一共展示了ConstantContact类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: frmEmailCampaign_Load
private void frmEmailCampaign_Load(object sender, EventArgs e)
{
try
{
string state = "ok";
_accessToken = OAuth.AuthenticateFromWinProgram(ref state);
if (string.IsNullOrEmpty(_accessToken))
{
Application.Exit();
}
//initialize ConstantContact member
_constantContact = new ConstantContact(_apiKey, _accessToken);
}
catch (OAuth2Exception oauthEx)
{
MessageBox.Show(string.Format("Authentication failure: {0}", oauthEx.Message), "Warning");
}
PopulateCampaignTypeList();
PopulateListOfCountries();
PopulateUSAndCanadaListOfStates();
GetListOfContacts();
PopulateEmailLists();
}
开发者ID:GoldMineCloud,项目名称:.net-sdk,代码行数:27,代码来源:Form1.cs
示例2: LiveVerifiedEmailAddressTest
public void LiveVerifiedEmailAddressTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var list = cc.GetVerifiedEmailAddress();
Assert.IsNotNull(list);
Assert.AreNotEqual(0, list.Count);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:8,代码来源:CtctUnitTest.cs
示例3: LiveActivityExportContactsTest
public void LiveActivityExportContactsTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var lists = new List<string>() { "1" };
ExportContacts export = new ExportContacts();
export.Lists = lists;
Activity activity = cc.AddExportContactsActivity(export);
Assert.IsNotNull(activity);
Assert.IsNotNull(activity.Id);
Assert.AreEqual(activity.Type, "EXPORT_CONTACTS");
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:14,代码来源:CtctUnitTest.cs
示例4: GetLibraryInfoTest
public void GetLibraryInfoTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var result = cc.GetLibraryInfo();
Assert.IsNotNull(result);
Assert.IsNotNull(result.UsageSummary);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:8,代码来源:CtctUnitTest.cs
示例5: LiveActivityClearListTest
public void LiveActivityClearListTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var emailAddresses = new List<string> { String.Format("{0}@example.com", Guid.NewGuid()) };
var lists = new List<string> { "2" };
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = emailAddresses
}
},
lists,
null
);
Activity act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
Activity activity = cc.AddClearListsActivity(lists);
Assert.IsNotNull(activity);
Assert.AreEqual(activity.Type, "CLEAR_CONTACTS_FROM_LISTS");
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:23,代码来源:CtctUnitTest.cs
示例6: LiveDeleteContactListTest
public void LiveDeleteContactListTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contactList = new ContactList
{
Name = string.Format("List {0}", Guid.NewGuid()),
Status = Status.Active
};
var result = cc.AddList(contactList);
Assert.IsNotNull(result);
Assert.IsTrue(result.Name.Equals(contactList.Name));
result.Name = string.Format("List - {0}", Guid.NewGuid());
var deleted = cc.DeleteList(result.Id.ToString(CultureInfo.InvariantCulture));
Assert.IsTrue(deleted);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:20,代码来源:CtctUnitTest.cs
示例7: LiveDeleteFolderTest
public void LiveDeleteFolderTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var folder = new MyLibraryFolder();
folder.Id = Guid.NewGuid().ToString();
folder.Name = Guid.NewGuid().ToString();
folder.CreatedDate = Extensions.ToISO8601String(DateTime.Now);
folder.ModifiedDate = Extensions.ToISO8601String(DateTime.Now);
var newFolder = cc.AddLibraryFolder(folder);
bool result = cc.DeleteLibraryFolder(newFolder.Id);
Assert.IsTrue(result);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:14,代码来源:CtctUnitTest.cs
示例8: LiveGetContactByEmail
public void LiveGetContactByEmail()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contact = new Contact();
contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });
Contact nc = cc.AddContact(contact, false);
Assert.IsNotNull(nc);
Assert.IsNotNull(nc.Id);
var result = cc.GetContacts(nc.EmailAddresses[0].EmailAddr, 1, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(result);
Assert.IsNotNull(result.Results);
Assert.AreEqual(1, result.Results.Count);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:17,代码来源:CtctUnitTest.cs
示例9: LiveGetContactFromListTest
public void LiveGetContactFromListTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
IList<ContactList> lists = cc.GetLists(DateTime.Now.AddMonths(-1));
Assert.IsNotNull(lists);
Assert.AreNotEqual(0, lists.Count);
ResultSet<Contact> contacts = cc.GetContactsFromList(lists[0].Id, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(contacts);
Assert.IsNotNull(contacts.Results);
contacts = cc.GetContactsFromList(lists[0].Id, 3, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(contacts);
Assert.IsNotNull(contacts.Meta);
Assert.IsNotNull(contacts.Meta.Pagination);
Assert.IsNotNull(contacts.Meta.Pagination.Next);
Assert.IsNotNull(contacts.Results);
Assert.AreEqual(3, contacts.Results.Count);
contacts = cc.GetContactsFromList(DateTime.Now.AddMonths(-1), contacts.Meta.Pagination);
Assert.IsNotNull(contacts);
Assert.IsNotNull(contacts.Meta);
Assert.IsNotNull(contacts.Meta.Pagination);
Assert.IsNotNull(contacts.Meta.Pagination.Next);
Assert.IsNotNull(contacts.Results);
Assert.AreEqual(3, contacts.Results.Count);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:28,代码来源:CtctUnitTest.cs
示例10: LiveEmailCampaignTestSendTest
public void LiveEmailCampaignTestSendTest()
{
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);
var test = new TestSend {
Format = EmailFormat.HTML_AND_TEXT.ToString(),
PersonalMessage = "This is a test send of the email campaign message.",
EmailAddresses = new List<string> { CustomerEmail }
};
var testSend = cc.SendTest(camp.Id, test);
Assert.IsNotNull(testSend);
Assert.AreEqual(test.Format, testSend.Format);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:51,代码来源:CtctUnitTest.cs
示例11: LiveUpdateContactTest
public void LiveUpdateContactTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var contact = new Contact();
contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });
var nc = cc.AddContact(contact, false);
Assert.IsNotNull(nc);
Assert.IsNotNull(nc.Id);
nc.CompanyName = "some company";
var retrievedContact = cc.UpdateContact(nc, false);
Assert.IsNotNull(retrievedContact);
Assert.AreEqual(retrievedContact.Id, nc.Id);
Assert.AreEqual(retrievedContact.CompanyName, nc.CompanyName);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:20,代码来源:CtctUnitTest.cs
示例12: LiveCampaignTrackingGetClicksTest
public void LiveCampaignTrackingGetClicksTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var camp = CreateTestCampaign(cc);
ResultSet<ClickActivity> result = cc.GetCampaignTrackingClicks(camp.Id, "1", null, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(result);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:10,代码来源:CtctUnitTest.cs
示例13: CreateTestCampaign
private EmailCampaign CreateTestCampaign(ConstantContact cc)
{
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 ",
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);
DateTime schDate = DateTime.Now.AddDays(1);
Schedule schedule = cc.AddSchedule(camp.Id, new Schedule { ScheduledDate = schDate });
Assert.IsNotNull(schedule);
Assert.AreNotEqual(0, schedule.Id);
Assert.IsNotNull(schedule.ScheduledDate);
return camp;
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:45,代码来源:CtctUnitTest.cs
示例14: LiveGetFilesByFolderTest
public void LiveGetFilesByFolderTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var folders = cc.GetLibraryFolders();
Assert.IsNotNull(folders);
Assert.IsNotNull(folders.Results);
Assert.AreNotEqual(0, folders.Results.Count);
var files = cc.GetLibraryFilesByFolder(folders.Results[0].Id);
Assert.IsNotNull(files);
Assert.IsNotNull(files.Results);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:13,代码来源:CtctUnitTest.cs
示例15: LiveDeleteTrashFilesTest
public void LiveDeleteTrashFilesTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var result = cc.DeleteLibraryTrashFiles();
Assert.IsTrue(result);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:7,代码来源:CtctUnitTest.cs
示例16: LiveGetTrashTest
public void LiveGetTrashTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var files = cc.GetLibraryTrashFiles();
Assert.IsNotNull(files);
Assert.IsNotNull(files.Results);
//Assert.AreNotEqual(0, files.Results.Count);
}
开发者ID:hm992003,项目名称:.net-sdk,代码行数:9,代码来源:CtctUnitTest.cs
示例17: LiveActivityGetSummaryReportTest
public void LiveActivityGetSummaryReportTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = new List<string>{ String.Format("{0}@example.com", Guid.NewGuid()) }
}
},
new List<string> { "1" },
null
);
Activity act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
IList<Activity> list = cc.GetActivities();
foreach (Activity activity in list)
{
Activity a = cc.GetActivity(activity.Id);
Assert.IsNotNull(a);
}
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:22,代码来源:CtctUnitTest.cs
示例18: LiveContactTrackingSummaryTest
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);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:22,代码来源:CtctUnitTest.cs
示例19: LiveGetAllContacts
public void LiveGetAllContacts()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var result = cc.GetContacts(DateTime.Now.AddMonths(-1));
Assert.IsNotNull(result);
Assert.IsNotNull(result.Results);
Assert.AreNotEqual(0, result.Results.Count);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:9,代码来源:CtctUnitTest.cs
示例20: LiveContactTrackingForwardsTest
public void LiveContactTrackingForwardsTest()
{
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);
ResultSet<ForwardActivity> fa = cc.GetContactTrackingForwards(contacts.Results[0].Id, DateTime.Now.AddMonths(-1));
Assert.IsNotNull(fa);
}
开发者ID:kstatz12,项目名称:.net-sdk,代码行数:12,代码来源:CtctUnitTest.cs
注:本文中的CTCT.ConstantContact类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论