You are here

function CMBase::subscriberAdd in Campaign Monitor 5.2

* subscriberAdd() *

Parameters

string $email Email address.: * @param string $name User's name. * @param int $list_id (Optional) A valid List ID to check against. If not given, the default class property is used. * @param boolean $resubscribe If true, does an equivalent 'AndResubscribe' API method. * @see http://www.campaignmonitor.com/api/Subscriber.Add.aspx

2 calls to CMBase::subscriberAdd()
CampaignMonitor::subscriberAddAndResubscribe in lib/CMBase.php
*
CMBase::subscriberAddRedundant in lib/CMBase.php
* This encapsulates the check of whether this particular user unsubscribed once. *

File

lib/CMBase.php, line 384

Class

CMBase

Code

function subscriberAdd($email, $name, $list_id = null, $resubscribe = false) {
  if (!$list_id) {
    $list_id = $this->list_id;
  }
  $action = 'Subscriber.Add';
  if ($resubscribe) {
    $action = 'Subscriber.AddAndResubscribe';
  }
  return $this
    ->makeCall($action, array(
    'params' => array(
      'ListID' => $list_id,
      'Email' => $email,
      'Name' => $name,
    ),
  ));
}