0

Connect your Meteor App with MailChimp

Does your application have users? I hope so! Keep them around and active.

The best way to get users engaged, and keep them coming back is to use email marketing. You can create a sign-up workflow, move users to different workflows based on what they are doing in your app, and re-engage users that haven’t logged in for X months/weeks. Its very easy, so here is some code that connects to the MailChimp API and lets you add users to Lists. Lists are what trigger the emails for each email address.

 

First step is to create a free MailChimp account.
Once you have that out of the way, you need an API key:

  1. Click your name in the top/right
  2. Click on Profile
  3. Under the Extras menu, click API keys
  4. Click the Create a Key button and a key will be generated

The key will be a string of random characters like c30f72sdfsdfsdfsdfsdfsdffsdfsdf-us1

 

The other piece of information we need is a List ID. If you don’t have an existing email list setup, then create a new list (this is under the Lists tab, then click “Create New List”).

 

Once you have identified the list you want to add/remove people from, click the Down Arrow icon on the far right, and goto “Settings”.

At the bottom of settings you will see: “Unique id for list xxxxxx”. Copy the value listed there, it will be something like 5c6e0000a11.

That’s all we need from MailChimp!

 

Feel free to browse the other API options they offer here:
http://developer.mailchimp.com/documentation/mailchimp/reference/overview/

Here is the code that will connect to their API and add a user:

That’s it! Not too bad once you get the hang of it. This pattern can be repeated for almost any API call that doesn’t require an OAuth workflow. That’s a different story!

Leave a Reply

Your email address will not be published. Required fields are marked *