kevindb / cf-mailchimp

ColdFusion wrapper for the MailChimp 3.0 API
GNU Lesser General Public License v2.1
18 stars 7 forks source link

Wrapper samples #1

Closed wfinley closed 8 years ago

wfinley commented 8 years ago

Just thought I'd leave some sample wrapper code for those who are getting around to upgrading to 3.0. Below is some sample code for putListMember. Cheers!

` mc = new MailChimp(
apiKey="YOURAPIKEY", // see http://kb.mailchimp.com/accounts/management/about-api-keys
serviceURL="https://us1.api.mailchimp.com/3.0/", debug="true"); // note debug setting lists = mc.getLists(); newMember = mc.putListMember(
listId="YOURLISTID", // see http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id data={ "email_address":"hey@hey.com", "status":"subscribed", "merge_fields" = {"FNAME":"Hey", "Now":"Finley","COMPANY":"Acme"} }
);

`