Library: Campaign Monitor API |
[eluser]Ben Hirsch[/eluser]
Hi all. This is probably not the most elegant solution but it was a nice way to get CM working with CI quickly. 1) Grab the CM php sample from here: http://code.google.com/p/campaignmonitor...loads/list 2) Take the file CMBase.php from the download, rename it to CampaignMonitor.php and put it in your /system/application/libraries/ directory. 3) Find the following function (within the CampaignMonitor class): Code: function CampaignMonitor( $api = null, $client = null, $campaign = null, $list = null, $method = 'get' ) and replace it with: Code: function CampaignMonitor( $api = null, $client = null, $campaign = null, $list = null, $method = 'get' ) 4) Then you can use it like this: Code: function _add_to_cm($email) { ... and you can use this function in your controller. Replace the api and list values with your own. (more info here: http://www.campaignmonitor.com/api/required/) Of course, you can use any CM API method you want. Just look at the documentation. But this will get you started with tunneling commands through the CM wrapper (CMBase.php) without having to make too many edits to the file. |
Messages In This Thread |
Library: Campaign Monitor API - by El Forum - 05-21-2009, 07:40 PM
Library: Campaign Monitor API - by El Forum - 07-16-2009, 07:49 AM
Library: Campaign Monitor API - by El Forum - 11-26-2009, 04:13 AM
|