Sitecore 8.2 Get mailing list from MailChimp API

Xing Liu • 3/20/2017

Recently, there was a project requirement that needed to get a list of email addresses from a MailChimp account’s existing list.  MailChimp provides a 3.0 API to retrieve the necessary information. You can find the MailChimp API references from the following link:

Furthermore, there is a developed MailChimp API 3.0 wrapper for .Net framework already, which is good for integration with Sitecore project.  It’s available for Nuget package download called MailChimp.Net, which is a MailChimp 3.0 API wrapper developed by Brandon Seydel. With this wrapper, you can easily retrieve the subscribers from a MailChimp list using the calls below:

List<string> emails = new List<string>();
IMailChimpManager mailChimpManager = new MailChimpManager(Settings.GetSetting("MailChimpAPIKey"));
var mailChimpListCollection = mailChimpManager.Members.GetAllAsync(Settings.GetSetting("MailChimpBlogListId")).Result;

The function mailChimpManager.Members.GetAllAsync(ListId).Result returns a list of members from the MailChimp List, which you can retrieve the email from each member and do a bulk email messages operation from this point. 

Xing Liu

Xing has 5 years of experience with developing web solutions using ASP.NET and SQL Server. For the past 3 years, he has been actively engaged in website development projects using Sitecore CMS. He enjoys creating web solutions for clients using Sitecore CMS and, using its flexibility, provides cohesive and integrated solutions. Xing is a Sitecore Technology MVP, 2016.

Explore topics:

Other Blog Posts from Xing Liu