Mailchimp Integration


Mailchimp provides amazingly simple ways to manage your campaign extremely effectively. It automatically takes care of your sign-ups, un-subscribes, and bounce-back cleaning for the customer subscription for your campaigns. It provides various built-in tools to help you design and deliver great looking HTML email campaigns. Also, if you don’t like their template then you can design your own and upload that code in mailchimp.

The auto-responder functionality provides you an easy way to inform your customer about the context sensitive products based on the rules configured by you. Well, who doesn’t like to be wished on his / her birthday and when they see relevant stuff, they are in right mood as well to buy your stuffs.

Mailchimp goes one step ahead and it allows you to use the customer details (or call it customer dimension, if you have strong interest in BI) and accordingly plan your campaign. Some of the key features of Mailchimp, which is very handy, are:

  • Mail list Management including keeping track of customer’s interest
  • Subscriber preference management
  • Email Campaign Designer and pre-existing templates
  • Track and Manage Campaign

While WTC’s EagleRP also provides campaign management, the Mailchimp feature list of worth praising. Walking Tree has done integration work for integrating web-stores with physical stores by integrating mailchimp with magento and Microsoft Retail Management Software. In this article we are explaining how you can call a Mailchimp API from your program:

Before you can start interacting with Mailchimp, you need to register with Mailchimp. It gives you

  • apiKey, which you will get from account information. To get the API Key Sign  In into MailChimp account and click on “accounts -> api keys & info”.
  • list id where we want to insert the email id. To get the list id – click on “lists”, there you will get existing lists. Select “settings ->list settings and Unique id”.

Once you have got above two information, you need an instance of mailchimp service object (say mcServices). Now everything is straight forward.

//API Key – see http://admin.mailchimp.com/account/api or run login() once
private final String        apiKey        = “your-api-key-us1”;

// A List Id to run examples against. use lists() to view all
// Also, login to MC account, go to List, then List Tools, and look for the List ID entry
private final String        listId        = “your-list-id”;

private IMailChimpServices    mcServices    = null;

public void initialize() {
mcServices = MailChimpServiceFactory.getMailChimpServices();
final String ping = mcServices.ping(apiKey);
if (IMailChimpServices.PING_SUCCESS.equals(ping)) {
logger.error(“MailChimp connection pinged successfully”);
} else {
logger.error(“Failed to ping MailChimp, response: ” + ping);
}
}

Now, You can use listSubscribe() method is used to add the email id and details into MailChimp list

final boolean listSubscribe = mcServices.listSubscribe( apiKey,

listId,

rs.getString(52),

mergesIMailChimpServices.EMAIL_TYPE_HTML,

false);

Similarly, you can call listMembers API to get all the subscribed customer list from the mailchimp, which you can use in other program to take further decisions .

final Object[] listMembers = mcServices.listMembers( apiKey,

listId,

IMailChimpServices.STATUS_SUBSCRIBED,

“2009-01-01 00:00:00”,

0,

1000);

And,you can use listUnsubscribe API to remove the users / email from the Mailchimp.

final boolean listUnsubscribe = mcServices.listUnsubscribe( apiKey,

listId,

“ramu@raj.com”,

true,

true,

true);

Similarly,corresponding update API can be called to update an existing information.

listUpdateMember(string apikey, string id, string email_address, array merge_vars, string email_type, boolean replace_interests)listUpdateMember(string apikey, string id, string email_address, array merge_vars, string email_type, boolean replace_interests)

This provides us CRUD (Create, Read, Update and Delete) APIs to manage the mailchimp data using external program. Thus it makes integration extremely easy.

You can look at following information to develop better understanding about mailchimp

I hope this article was useful for you. If you need any professional help from Walking Tree, you can find out contact details at our company website.

Tagged with: , , , , , ,
Posted in General

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

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Recent Publication
%d bloggers like this: