You are here

function CMBase::subscriberAddWithCustomFieldsRedundant in Campaign Monitor 5.2

* Same as subscriberAddRedundant() except with CustomFields. * *

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. * @return mixed A parsed response from the server, or null if something failed.

File

lib/CMBase.php, line 485

Class

CMBase

Code

function subscriberAddWithCustomFieldsRedundant($email, $name, $fields, $list_id = null) {
  $added = $this
    ->subscriberAddWithCustomFields($email, $name, $fields, $list_id);
  if ($added && $added['Code'] == '0') {
    $subscribed = $this
      ->subscribersGetIsSubscribed($email);
    if ($subscribed == 'False') {
      $added = $this
        ->subscriberAddWithCustomFields($email, $name, $fields, $list_id, true);
      return $added;
    }
  }
  return $added;
}