Updated: New Version 0.99 - Still unfinished

Yes, it is still an unfinished version (v.0.99) I only implemented methods we actually needed for client work. If anything is missing and you add to it, please share with the rest of us.

Available Methods for interaction with Mailchimp API

  • isEmail
  • login (depricated in MCApi.1.2)
  • listBatchSubscribe
  • ListBatchUnsubscribe
  • listInterestGroupAdd
  • ListInterestGRoupDel
  • ListMemberinfo
  • ListMembers
  • lists
  • listInterestGroups
  • listSubscribe
  • listUnsubscribe
  • CampaignContent
  • campaigns
  • campaignStats
  • CampaignAbuseReports
  • CampaignClickStats
  • CampaignHardBounces
  • campaignSoftBounces
  • campaignUnsubscribes
  • CampaignEmailStatsAIMAll
  • createCampaign
  • listTemplates

Earlier this week a fellow programmer pointed out to me just how far behind the posted version of this CFC was, that I had to jump to action and share my updated version, that we us now since December 2010.

The 1.2 invocation code

I still need to read up about v1.3 changes of the API.
<cfset apiKey = "GetYourOwnAPIKey">
<cfset url= "http://#listlast(application.mc.apiKey, "-")#.api.mailchimp.com/1.2/">
<cfset output = "xml">
<cfset mp = createObject("component","components.mailchimp099").init(apiKey,url,output)>
You need to replace "GetYourOwnAPIKey" with your account's API Key. You'll find it on Mailchimp under Account Settings > APIKeys https://us1.admin.mailchimp.com/account/api

For a query recordset of all your lists:
<cfset qryMylists = mp.lists(apikey)>

For Groups of a specific list
<cfset interestgroups = mp.listInterestGroups(apikey,listid)>
   
<ul>
<cfloop from="1" to="#ArrayLen(interestgroups.groups)#" index="g">
   <cfoutput><li>#interestgroups.groups[g]#</li></cfoutput>
</cfloop>
</ul>

A set of Templates:
<cfset qryMyTemplates = mp.listTemplates(application.mc.apikey)>
These examples should get you started.

Feel free to email (bph@idxtools.org) me with suggestions, corrections and other comments. Or stop by our IDXTools blog and leave a comment.

You can also follow me on Twitter: @bph

Stay in touch!

Includes now AIM stats

The major update is the inclusion of the "campaignEmailStatsAIMAll" method. In order to use this method, you would need to have AIM Reporst enabled on your MailChimp account.

It's an upgrade that cost around $49 one-time fee. It will enable you to retrieve MailChimp stats on a subscriber basis and this CFWrapper method will help you update your own CRM system with the Mailchimp history data.

Other updates were mostly basic code clean-up and error inclusion for the methods "login" and "campaignEmailStatsAIMAll"

(+) testCampaignAIMStats.cfm to test your AIM stats

(+) testCampaigns.cfm includes now a link to AIM stats per campaign.

(+) mailChimp.cfc with added methods.

Note: There have been users downloading the cfc and I would really like some feedback if it's working not working, something missing...

Happy New Year! May the force be with you!

MailChimp XML output on Click Stats

MailChimp has fixed that the clicked url was missing, unfortunately, however the xml output does not escape & to & so CF xml parser still chokes.

Stay tuned.

Today's updates

(-) Interestgroups method, now returns a structure
(-) CampaignAbuseReports method, all tested now
(-) (+) Added CampaignUnsubscribes method
(+) Added CampaignHardBounces method
(+) Added CampaignSoftBounces method
(-) Improved the flow for the various methods in the test files
(+) Added test.cfm as starting point for your test.

Getting Started: How to call the test files in usable order.

Update start with test.cfm ------

  1. Get yourself an account with MailChimp.com
  2. Create a list at MailChimp.com
  3. add username & password to settings.cfm
  4. include settings.cfm in any test files you create as it provides the apikey for your other calls to the API. Later on I would store the API in a persistent scope or DB.
  5. Edit testBatchSubscriber.cfm and add subscribers to a list.
  6. Create a Campaign on MailChimp.com (the interface there is much richer than I could create here on the fly)
  7. Sent the campaign to your test list.

  8. Here is the list of dependencies of various test templates in cluded in the zip file:
    testLists.cfm
    links to testListMembers.cfm, which links to testMemberinfo.cfm

    testCampaign.cfm
    links to testCampaignStats.cfm (links to testStatsDetails.cfm) & testCampaignContent.cfm

Updated compontent and test templates

(-) fixed a typo in return type.
(+) better flow of test templates for lists, member and campaign information(read: Getting Started)
(-) fixed CampaignStats method
(-) return member struct for listMemberinfo method.
(-) display all stats values in testCampaignStats
(+) added CampaignAbuseReports method (test mode)
(+) added CampaignClickStats method (test mode)
( CampaignClicks call doesn't return URLs from API. Bug report sent to MailChimp (11/14 10:45 pm))
(+) added testStatsDetails.cfm

Started to post early releases

The API of MailChimp is quite extensive, one of the more comprehensive APIs for e-mail marketing applications.

This project is certainly a work in progress on so many levels. For now it only includes a sub set of method: The most important and the ones, I need for a particular project.

I also make available my test templates so it's easier to find out how it all works without a lot of narrative documentation.

Feel free to send me your requests and changes, once you start using it.

Before you start, get yourself an account at MailChimp and create your campaign. It really might help to be familiar with MailChimp SaaS before integrating it into any of your applications.

.... To be continued.

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress