CMBase users: adding access to Subscribers.GetSingleSubscriber

Hi folks,

If you have been following our travails with using CMBase.php here among several other posts then you will have seen that in order to use the API to set custom fields you must set them all every time you touch a record.

Per CM staff you need to use Subscribers.GetSingleSubscriber which does not exist in the CMBase.php functions so I have added it.

My tests look good.  If you find any problems please post back here.

    /**  Added by David Martin 9.23.09 
    * @param string $email Email address.
    * @param int $list_id (Optional) A valid List ID to check against. If not given, the default class property is used.
    * @param boolean $check_subscribed If true, does the Subscribers.GetIsSubscribed API method instead.
    * @return mixed A parsed response from the server, or null if something failed.
    * @see http://www.campaignmonitor.com/api/method/subscribers-get-single-subscriber/
    */
    
    function subscriberGetSingleSubscriber( $email, $list_id = null )
    {
        if ( !$list_id )
            $list_id = $this->list_id;
        
        $action = 'Subscribers.GetSingleSubscriber';
        
        return $this->makeCall( $action
            , array(
                'params' => array(
                    'ListID' => $list_id
                    , 'EmailAddress' => $email
                )
            )
        );
    }

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free