function seed_cspv4_emaillist_icontact_add_subscriber($args) { global $seed_cspv4, $seed_cspv4_post_result; extract($seed_cspv4); require_once SEED_CSPV4_PLUGIN_PATH . 'extentions/icontact/seed_cspv4_iContactApi.php'; require_once SEED_CSPV4_PLUGIN_PATH . 'lib/nameparse.php'; // If tracking enabled if (!empty($enable_reflink)) { seed_cspv4_emaillist_database_add_subscriber(); } $pass = $icontact_password; $username = $icontact_username; $listId = $icontact_listid; $name = ''; if (!empty($_REQUEST['name'])) { $name = $_REQUEST['name']; } $email = $_REQUEST['email']; $fname = ''; $lname = ''; if (!empty($name)) { $name = seed_cspv4_parse_name($name); $fname = $name['first']; $lname = $name['last']; } seed_cspv4_iContactApi::getInstance()->setConfig(array('appId' => 'puD4TZWs2kKlKZLZZgD7IAUiqPSYPIvd', 'apiPassword' => $pass, 'apiUsername' => $username)); $oiContact = seed_cspv4_iContactApi::getInstance(); $user = array('email' => $email, 'firstName' => $fname, 'lastName' => $lname, 'add_list' => $listId); $contact = $oiContact->addContact($email, $sStatus = 'normal', $sPrefix = null, $sFirstName = $fname, $sLastName = $lname); $response = $oiContact->subscribeContactToList($contact->contactId, $listId, $sStatus = 'normal'); if (empty($response)) { $seed_cspv4_post_result['status'] = '500'; } else { // if(!empty($enable_reflink)){ // seed_cspv4_emaillist_database_add_subscriber(); // } if (empty($seed_cspv4_post_result['status'])) { $seed_cspv4_post_result['status'] = '200'; } } }
/** * This resets the singleton instance to null * @static * @access public * @return void **/ public static function resetInstance() { // Reset the instance self::$oInstance = null; }