public function subscribe($email_id, $email_type = 'html', $double_optin = true, $update_existing = true, $replace_interests = true, $send_welcome = false, $email_identifier = 'email') {
        if (!in_array($email_identifier, array("email", "euid", "leid")))
            throw new InvalidArgumentException('email identifier should be one of ("email","euid","leid")');

        $payload = array(
            'id' => $this->listId,
            'email' => array(
                $email_identifier => $email_id
            ),
            'merge_vars' => $this->merge_vars,
            'email_type' => $email_type,
            'double_optin' => $double_optin,
            'update_existing' => $update_existing,
            'replace_interests' => $replace_interests,
            'send_welcome' => $send_welcome
        );

        $apiCall = 'lists/subscribe';
        $data = $this->requestMonkey($apiCall, $payload);
        $data = json_decode($data, true);
        if (isset($data['error']))
            throw new MailchimpAPIException($data);
        else
            return isset($data) ? $data : false;
    }
public function subscribe($email_id, $email_type = 'html', $double_optin = true, $update_existing = true, $replace_interests = true, $send_welcome = false, $email_identifier = 'email') {
        if (!in_array($email_identifier, array("email", "euid", "leid")))
            throw new InvalidArgumentException('email identifier should be one of ("email","euid","leid")');

        $payload = array(
            'id' => $this->listId,
            'email' => array(
                $email_identifier => $email_id
            ),
            'merge_vars' => $this->merge_vars,
            'email_type' => $email_type,
            'double_optin' => $double_optin,
            'update_existing' => $update_existing,
            'replace_interests' => $replace_interests,
            'send_welcome' => $send_welcome
        );

        $apiCall = 'lists/subscribe';
        $data = $this->requestMonkey($apiCall, $payload);
        $data = json_decode($data, true);
        if (isset($data['error']))
            throw new MailchimpAPIException($data);
        else
            return isset($data) ? $data : false;
    }
public function subscribe ( $ email_id , $ email_type = 'html' , $ double_optin = true , $ update_existing = true , $ replace_interests = true , $ send_welcome = false , $ email_identifier = 'email' ) { if ( ! in_array ( $ email_identifier , array ( "email" , "euid" , "leid" ) ) ) throw new InvalidArgumentException ( 'email identifier should be one of ("email","euid","leid")' ) ; $ payload = array ( 'id' => $ this -> listId , 'email' => array ( $ email_identifier => $ email_id ) , 'merge_vars' => $ this -> merge_vars , 'email_type' => $ email_type , 'double_optin' => $ double_optin , 'update_existing' => $ update_existing , 'replace_interests' => $ replace_interests , 'send_welcome' => $ send_welcome ) ; $ apiCall = 'lists/subscribe' ; $ data = $ this -> requestMonkey ( $ apiCall , $ payload ) ; $ data = json_decode ( $ data , true ) ; if ( isset ( $ data [ 'error' ] ) ) throw new MailchimpAPIException ( $ data ) ; else return isset ( $ data ) ? $ data : false ; }
Subscribe an email addresses to a list,
These calls are also long, so be sure you increase your timeout values

@link http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php
@param string $email
@param string $email_type
@param boolean $double_optin optional
@param boolean $update_existing optional
@param boolean $replace_interests optional
@param boolean $send_welcome optional
@param string $email_identifier optional can be (email,euid, leid)
@return array
@throws MailchimpAPIException
Subscribe an email addresses to a list These calls are also long so be sure you increase your timeout values