danesparza/MailChimp.NET — pull request #73 by Yagg (2014-04-14 11:49:55+00:00)
Title: campaigns/template-content support and small changes to Subscribe method

1. Returns the support of custom dictionary for the MergeVars parameter of Subscribe. Old code still works fine.

[System.Runtime.Serialization.DataContract]
public class MyMergeVar : MergeVar
{
[System.Runtime.Serialization.DataMember(Name = "FNAME")]
public string FirstName { get; set; }
[System.Runtime.Serialization.DataMember(Name = "LNAME")]
public string LastName { get; set; }
}

MailChimpManager mc = new MailChimpManager("YourApiKeyHere-us2");
EmailParameter email = new EmailParameter()
{
Email = "customeremail@righthere.com"
};
MyMergeVar myMergeVars = new MyMergeVar();
myMergeVars.Groupings = new List<Grouping>();
myMergeVars.Groupings.Add(new Grouping());
myMergeVars.Groupings[0].Id = 1234; // replace with your grouping id
myMergeVars.Groupings[0].GroupNames = new List<string>();
myMergeVars.Groupings[0].GroupNames.Add("Your Group Name");
myMergeVars.FirstName = "Testy";
myMergeVars.LastName = "Testerson";
EmailParameter results = mc.Subscribe(strListID, email, myMergeVars); // Works
EmailParameter results = mc.Subscribe(strListID, email, new Dictionary{{"FNAME", "Yagg"}, {"LNAME", "Adder"}, {"mc_language", "ru"}}); // Works too.

2. campaigns/template-content support