Coder Social home page Coder Social logo

kevindb / cf-mailchimp Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 7.0 38 KB

ColdFusion wrapper for the MailChimp 3.0 API

License: GNU Lesser General Public License v2.1

ColdFusion 100.00%
coldfusion mailchimp mailchimp-api api-wrapper coldfusion-library lucee

cf-mailchimp's People

Contributors

gunnarlieb avatar kevindb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cf-mailchimp's Issues

Wrapper samples

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":"[email protected]",
"status":"subscribed",
"merge_fields" = {"FNAME":"Hey", "Now":"Finley","COMPANY":"Acme"}
}
);

`

API Key Missing Error

Every time I try to call a method I get "API Key Missing" even though it is set and entered into the "password" field. Was the API updated?

I am using Lucee 4.5 on Ubuntu 12.04.

Boolean is serialized to a string

We need the ability to add a subscriber directly to a group/interest in our mailing list. So for example our master list has 3 groups in it. We have figured out how to get the group/interest ID and we tried to modify the code like so.

`
mc = new cfc.mailchimp(
apiKey = "MYAPIKEYHERE", // see http://kb.mailchimp.com/accounts/management/about-api-keys
serviceURL = "https://us1.api.mailchimp.com/3.0/",
debug = false // note debug setting
);

lists = mc.getLists();

newMember = mc.putListMember(
listId = "MainListID", // see http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
data = {
"email_address" = "#FORM.EMAIL#",
"status" = "subscribed",
"merge_fields" = {
"FNAME" = "#FORM.FNAME#",
"LNAME" = "#FORM.LNAME#"
},
"interests" = {"GroupID" = true}
}
);
`

When we attempt this we get this back.

Schema describes boolean, string found instead

Any idea how this could be accomplished?

Headline says 2.0

ColdFusion wrapper for the MailChimp 2.0 API
while it's 3.0

What's about putting it on Forgebox, I can do a PR for box.sjon file if you like?

capitalization of the keys in querystring

Adobe ColdFusion 10
default parameter EXCLUDE_FIELDS=_links was not working as it was being passed in capital letters. turning it into small letters exclude_fields=_links worked.

mailchimp.cfc
line: 325
original
response = listAppend(response, key & "=" & urlEncodedFormat(arguments.params[key]), "&");
changed
response = listAppend(response, lcase(key) & "=" & urlEncodedFormat(arguments.params[key]), "&");

Note: I am not yet fully aware of the mailchimp API as if it may need some parameters in mixed (lower/upper case) letters. In that case, this fix may lead to other issues as mailchimp API appears to be case sensitive.

Running on Lucee

I could not get the http calls running on Lucee, instead of supplying username and password I had to do

		httpService = new http(url=local.url, method="get");
		httpService.addParam(type="header",name="Authorization", value="apikey #getApiKey()#");

Can you check if this works as well on ACF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.