How to add a newsletter customer to MailChimp

It has to be easy to add users to a list which can be used to send newsletters. Modern newsletter campaigns are generated through tools like MailChimp, Amazon SES etc. So the challange is to the information about a user into a foreign system.
1 answer

Add email to list in Mailchimp

There are basicaly two ways to add multiple new users to a mailing list:
import a list:
http://kb.mailchimp.com/article/how-do-i-create-and-import-my-list
or to use the provided MailChimp-API:
for .net the are API-Wrappers (https://github.com/danesparza/MailChimp.NET, or https://github.com/danesparza/MailChimp.NET) available which makes the MailChimp-API easy to use. In the end its just about manipulating an object and passing it to a method.

MailChimpManager mc = new MailChimpManager("6e0fc756762e0234f06bfa27f5bbe-us7");

EmailParameter email = new EmailParameter(){ Email = txt_Mail.Text };

Dictionary attributes = new Dictionary();
attributes.Add("FNAME", txt_FirstName.Text);
attributes.Add("LNAME", txt_LastName.Text);

EmailParameter results = mc.Subscribe(Util.GetMailchimpListID(), email, attributes);

Taggings: