You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spyros edited this page Aug 16, 2013
·
4 revisions
==============
MailChimp.NET
.Net 4 wrapper Library for MailChimp newsletter API v2
Add the dlls to your project
Add the following links in your configuration file
<configuration>
<configSections>
<section name="MailChimpServiceSettings" type="MailChimp.Net.Settings.MailChimpServiceConfiguration, MailChimp.Net.Settings" />
3. Code example to subscribe a newsletter with the given groupings and merge vars
var subscribeSources = new Grouping {Name = "Subscribe Source"};
subscribeSources.Groups.Add("Site");
var couponsGained = new Grouping {Name = "Coupons Gained"};
couponsGained.Groups.Add("Coupon1");
var interests = new Grouping {Name = "Interests"};
interests.Groups.Add("Extreme Games");
var fields = new Dictionary
{
{"GENDER", "Male"},
{"DATEBORN", DateTime.Now.ToString(CultureInfo.InvariantCulture)},
{"CITY", "Athens"},
{"COUNTRY", "Greece"}
};
var response = mailChimpApiService.Subscribe(String.Format(emailPattern, i), new List() { subscribeSources, couponsGained, interests }, fields);