This is a quick how to, for people interested in adding subscribers to their Campaign Monitor lists. What you’ll need:
- PHP 5 with SOAP built in.
- A Valid Campaign Monitor Account
- A Campaign Monitor list
What’s assumed:
- You have a form already that’s collecting name and email address
- You know how to do basic input filtering
## ALL VALUES BELOW WERE GENERATED BY A RANDOM STRING GENERATOR CHANGE VALUES BELOW ##
// Campaign Monitor API Key
define('CM_APIKEY','wuc4vab7fik9v');// Campaign Monitor List ID
define('CM_ANALYZEROPTIN_LIST_ID','lub2iv6keg9fost2e');// Which client you're doing this for.
define('CM_CLIENT_ID','kov1hal9at7nau2w');## ALL VALUES ABOVE WERE GENERATED BY A RANDOM STRING GENERATOR CHANGE VALUES ABOVE ##
$client = new SoapClient("http://api.createsend.com/api/api.asmx?wsdl");
$params->ApiKey = CM_APIKEY;
$params->ListID = CM_ANALYZEROPTIN_LIST_ID;
#$params->clientID = CM_CLIENT_ID;$params->Email = "someaddress@example.com";
$params->Name = "Example Name";$result = $client->AddSubscriber($params);
Stay tuned for the next part in this series, which explains how to handle the $result and handle any errors.