You are here

public function CampaignMonitorManager::isSubscribed in Campaign Monitor 8.2

Check if user, identified by e-mail, is subscribed to a given list.

Parameters

string $listId: The unique Campaign Monitor list ID.

string $email: The user's e-mail address.

Return value

bool TRUE if subscribed, FALSE if not.

File

src/CampaignMonitorManager.php, line 948

Class

CampaignMonitorManager
Manager for Campaignmonitor.

Namespace

Drupal\campaignmonitor

Code

public function isSubscribed($listId, $email) {
  $result = $this
    ->getSubscriber($listId, $email);
  if (!empty($result)) {
    if ($result['State'] == 'Active') {
      return TRUE;
    }
  }
  return FALSE;
}