-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSubscriber.Add.php
More file actions
executable file
·29 lines (21 loc) · 995 Bytes
/
Copy pathSubscriber.Add.php
File metadata and controls
executable file
·29 lines (21 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
//Sample using the CMBase.php wrapper to call Subscriber.AddWithCustomFields from any version of PHP
//Relative path to CMBase.php. This example assumes the file is in the same folder
require_once('CMBase.php');
//Your API Key. Go to http://www.campaignmonitor.com/api/required/ to see where to find this and other required keys
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$client_id = null;
$campaign_id = null;
$list_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$cm = new CampaignMonitor( $api_key, $client_id, $campaign_id, $list_id );
//Optional statement to include debugging information in the result
//$cm->debug_level = 1;
//This is the actual call to the method, passing email address, name.
$result = $cm->subscriberAdd('joe@notarealdomain.com', 'Joe Smith');
if($result['Result']['Code'] == 0)
echo 'Success';
else
echo 'Error : ' . $result['Result']['Message'];
//Print out the debugging info
//print_r($cm);
?>