UPDATE: 2013-06-20 FileMaker 12 version of the demo is available that should work with Windows.UPDATE: 2012-08-07 Windows users with FileMaker 12 have an option to solve the JSON error message issue by swapping out the Web Viewer steps and instead employ the new Insert from URL script step. This will save a few lines of code and since it is not dependant on the Web Viewer framework, which in turn, relies on IE in Windows, the error message popping up should not be an issue. Mighty Data has some good information on Insert from URL is available here.UPDATE: 2011-10-10It has been pointed out that this demo does not work on Windows machines. It seems that Internet Explorer, the application that FileMaker employs in its Web Viewer on Windows machines is not capable of recognizing the JSON files returned from MailChimp. There is currently no workaround, but I will post here if there is any news.UPDATE: 2011-10-15 See the end of this blog entry for more suggestions for Windows users having the problem with JSON files.UPDATE: 2010-10-16 – The demo database updated to work with multiple data centers. It seems I left out a crucial step in making this work with the many MailChimp servers. My demo worked fine because my account happened to be on ‘us1’, but people who were on other servers were not so lucky. Many thanks to Dan Stein of Digital Software Solutions for pointing this out and working through a fix.UPDATE: 2011-11-26 Commentor Paul B has had some success employing MailChimp’s php syntax, instead of using the JSON format. See his comments at the bottom of Part 1.
The Demo database has been revised to include the ability to run updates on individual records. This was the missing piece in the demo that a few people commented on. The problem before was that you could subscribe and unsubscribe people from MailChimp, but if you wanted to keep their associated record history intact (what mailouts did they get etc.) you couldn’t because unsubscribing them was the equivalent of a delete.
See the previous two blog posts on this topic here:
Part 1 – an overview of why you might want to try to integrate FileMaker with MailChimp.
Part 2 – a longer description of how the Demo file works.
An important addition to the demo is the ability to run a batch action to grab the unique ID that MailChimp creates for each record. Once this ID is brought into FileMaker, you have a good mechanism to keep your records in sync.
The chart below details the steps and sequence in keeping the two data sets in sync.
FileMaker MailChimp Integration Process
If you perform these steps in this order, you stand a good chance of keeping things in sync.
The first step checks to see if the person record has a MailChimp Subscriber ID number assigned to it yet. If not, it will run the script to grab it. There is a potential hole in the system if you haven’t run the batch script to grab all these MailChimp Subscriber IDs yet. So remember to run that script right after uploading a batch of emails to MailChimp. Once they are processeed and accessible in MailChimp, take the time to grab these Subscriber IDs so future updates will make sense.
Main Processing step
This step is pretty similar to the Subscribe and Unsubscribe steps you saw in Part 2 of this blog series, with the exception that we are using the MailChimp Method called “listUpdateMember”.
listUpdateMember Method employed
Note that where we would ordinarily call the email address, we are instead calling the MailChimp Subscriber ID field.
Growl option for notification
I got tired of clicking away dialog boxes when I was testing and so instituted Growl messaging on the Mac platform. It employes a custom function for AppleScript Growl messages. Let’s hope FileMaker implements some sort of fading dialog boxes in the future.
“http://”& Settings::dataCenter &“.api.mailchimp.com/1.2/?method=listSubscribe&apikey=”&Settings::MailChimp Global API&”&id=”& Settings::MailChimp Mailing List API&”&email_address=”&Customers::Email&”&merge_vars[FNAME]=”&Trim(Customers::First Name)&”&merge_vars[LNAME]=”&Trim(Customers::Last Name)&$Groups&“&double_optin=false&output=json”This changes to the following:
“http://”& Settings::dataCenter &“.api.mailchimp.com/1.2/?method=listSubscribe&apikey=”&Settings::MailChimp Global API&”&id=”& Settings::MailChimp Mailing List API&”&email_address=”&Customers::Email&”&merge_vars[FNAME]=”&Trim(Customers::First Name)&”&merge_vars[LNAME]=”&Trim(Customers::Last Name)&$Groups&“&double_optin=false&output=php“
This approach doesn’t solve the IE problem with JSON, but may be another approach. The text returned does require a different approach to parsing the text. Please examine the source file that gets returned and parse accordingly.