You are here

function cc::query_contacts in Constant Contact 6.2

Same name and namespace in other branches
  1. 6.3 class.cc.php \cc::query_contacts()
  2. 7.3 class.cc.php \cc::query_contacts()

* This queries the API for contacts with a similar email address to the one you supply * * @access public

File

./class.cc.php, line 783

Class

cc
@file

Code

function query_contacts($email) {
  $xml = $this
    ->load_url('contacts?email=' . strtolower(urlencode($email)));
  if (!$xml) {
    return false;
  }
  $contact = false;
  $_contact = isset($xml['feed']['entry']) ? $xml['feed']['entry'] : false;

  // parse into nicer array
  if (is_array($_contact)) {
    $id = $this
      ->get_id_from_link($_contact['link_attr']['href']);
    $contact = $_contact['content']['Contact'];
    $contact['id'] = $id;
  }
  return $contact;
}