.Net wrapper for MailChimp v3.0

mailchimp_logo_2

A lot of you probably have already used MailChimp to market your product on the internet. I have used it several times for my client and portal experience is really a hassle free. For those of you who don’t know what mailchimp is let me simply state it in one line –

“MailChimp is a simple email marketing software (EMS) which gives you a number of easy options for designing, sending and saving templates of your emails.”

In the mid of 2015, MailChimp have officially released version 3.0 API and they start to deprecate their earlier version. Since they were deprecating their earlier version the only stable .Net wrapper for v2.0 also start losing its light. I followed danesparza on his github and he was planning to work for v3.0 but did not mention any date. I thought to give a pull request but then I realize mailchimp v2.0 is a weird hybrid of RESTful and RPC, almost all of their API interaction has changed in v3.0 . So, its better to design the whole wrapper from scratch. I also came across to their official blog where Pete Holiday says a good api should not need an sdk which clearly gave hint that they are not going to offer any wrapper/sdk for any language!

So, I Did one for .Net  😀

Its not fully done yet, but most of the features that you might need in your day to day business is already implemented. The best part is, it is open source in github here, so you can have a look on the code base and send me a pull request any time you want 🙂

You can fetch campaign analytic report, can manage your Template,  can create and send campaign, can automate the workflow. Pretty much all the features are already baked in with this wrapper, check the Read Me file  for details.

How to use it :

It’s dead simple. Fire up an console application and open the Package manager console and type:

mailchimp

Open the config file and add the following line.

<add key="MailChimpApiKey" value="--Your_MailChimp_APIKey--" />

Once you are done with this settings, you are good to use the entire wrapper 🙂

One question that you might be wondering with which class you are going to interact. Well, all class are prefixed with the word MailChimp. If you are using Visual Studio you can take the advantage of IntelliSense.

MailChimp_Intellisence

For example, if you want to work with Report then you should probably want to instantiate MailChimpReports class.

Following code demonstrate how you can Create a campaign, upload raw email template and send mail to its subscriber :

Disclaimer :

I have tried my best to make it a bug free, have checked the entire solution against test data and it passed all the time. But that really doesn’t ensure its fully bug free, this is because the data that I used to check the process was created by me! I have asked the mailchimp support team to provide test data/test account for this purpose and they said they don’t have anything like that! Anyway, great hanselman once said A Bug Report is a Gift.  So it is! If you find any bug feel free to create an issue. Please be specific about what’s not working.

Thats pretty much everything I could write about MailChimp.Api.Net. Buzz me in the comment section if you have any feedback.

 

Advertisements

10 thoughts on “.Net wrapper for MailChimp v3.0

  1. How can we adapt this so that we can pass in the API Key from code. Having just a single API Key in the app settings is too limiting. Great Job and thanks!

    • Tim: The current version MailChimp.Api.Net 1.2.0.3 only allows you to pass single API key from web.config file. Right now, you can’t pass it from code. To make the integration process simpler I designed it in such way.

  2. Install-package Mailchimp.api.net installs sharpcompress.dll
    Newtonsoft.Json.dll
    ‘MailChimp.Api.NET.dll not installed..

    • Hi Shahriar,

      I have a new list which includes some custom fields like First name , Last name , Moon Sign but
      i don’t know how to pass it to subscribe list and I am a very noob person so can you guide me to how to subscribe and unsubscribe from list with custom fields with this Package..

      Thanks

  3. Can you help me with a specific question.
    Using the API we get on a report the bounced, or hard bounced counter number. How I can get the list of specific email accounts that was bounced ?

    thanks in advance, i think you did a great job in your wrapper.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s