Syncing Database Changes from You to Mailchimp:
In this scenario, you, the customer, has a database/list of some sorts that will
be added to or updated by various methods according to what your business processes mandate.
However, you also need to make sure that some of that information is updated for your list
members too, especially before campaigns are sent.
Here are some situations where this might apply:
- You have a (Customer Relation Management) system that is added to / updated during your day-to-day business
- You offer a website that users register for and manage a profile on - possibly an Ecommerce store, blog, etc.
- You run a primate rescue center and... wait, what?
Before you even think about continuing, you are going to need:
- A programmer, preferably one that knows your system
- Select an API Wrapper or decide between using XML-RPC and building up your own HTTP Query Strings. If there is no wrapper, we suggest XML-RPC.
Yup, I qualify... now what?
First, let us preface this by saying "there are a lot ways that this can be done" - your exact implementation will vary based on your system and your preferences. What we are presenting here are the basic steps and how we'd like to be able to do it in a perfect world.
Typically what we expect to see customers do is Create a List, then setup some Merge Vars and maybe Interest Groups to match fields in their database(s) that they need to use when sending newsletters. Use may mean "include custom fields in the email content" or even just "segment my list based on this field". Some examples:
- First Name and Last Name - may be included in your content to give your messasge a personal touch
- State / Location - may be included to segment a list and send a message only to customers in a certain area
- Store Number visited - could be included to provide dynamic, conditional content based on the store a customer usually visits
The first things you will need to determine are which customers to update and when to update them:
Which:
We suggest you do this one of two ways:- Use a database field to track when users are updated and when your last sync occurred. Then just update everyone who has been updated since your last sync.
- Keep a list/table of users that need to be sync'd - have a process run through that list/table at a scheduled time.
When:
Typically you would run this sync process on your side once a night and possibly once more right before a campaign is going to go out.Under NO circumstances should you setup a process that tries to sync EVERY on of your users to us on a regular basis!
Ok, so what is this "sync process"
The sync process that we keep mentioning is simply a small script or program that your programmer(s) will write to essentially "copy" your data to the MailChimp system. These programs should be scheduled to run nightly (see when above) and will generally follow this pattern:- Grab the users to be updated/created (see which above)
- For each user, depending on their status, call:
- listSubscribe() to add new users to your List
- listUpdateMember() to update existing users on your List
- listUnsubscribe() to remove old users on your List