Jump to content
Latest News: (loading..)
Sign in to follow this  
604media

Campaign Monitor integration

Recommended Posts

I have made a Campaign Monitor subscribe/unsubscribe pages for osc 2.2 - if anyone's interested, I'll explain the way I did it. Bascially, you put the Campaign Monitor class etc. file in you includes directory, and

re-write the subscription scripts, moving ALL list management to Campaign Monitor. I didn't want any newsletter email information in my customer (or newsletters) tables ie. no updates to these table because I'm running all emailing from Campaign Monitor, but you could easily add that functionality in too.

 

The CM API is fairly easy to use once you check out the samples, but here's the high level process:

- Set up your CM list, adding custom fields as required

- Get your account and list API keys, and add them to configure.php)

- Authorize yourself using the keys:

    $auth = array('api_key' => API_KEY);
    $wrap = new CS_REST_General($auth);

 

- Set up your data in an array to pass to CM->add method. Precision is required for the structure (see samples).

 

- Make the Subscribers object eg.
    $CM_Subscriber = new CS_REST_Subscribers(LIST_ID, $auth);

-  Add the new subscriber - note set up of custom variables in array.
    //        Also note first name and last name must be custom fields.
    $result = $CM_Subscriber->add($subscriber);

 

- Check the $result->http_response_code to make sure you got one in the 200- - 400 ranges

Edited by p2409

OSC User Definitions

"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.

"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why

"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×