public function submitSubscribe($listID, $composedItem = [])
    {

        $results = $this->mailChimp->call("lists/subscribe",
            [
                'id' => $listID,
                'email' => [
                    'email' => $composedItem['email']['email']
                ],
                'merge_vars' => $composedItem['merge_vars'],
                'double_optin' => false,
                'update_existing' => true,
                'replace_interests' => false,
                'send_welcome' => false,
            ]);

        // Trap errors
        if (isset($results['error'])) {
            throw new Exception('Call to lists/subscribe returned error response: ' . $results['name'] . ': ' .  $results['error']);
        } elseif ($results == 0) {
            throw new Exception('Hmmm: No results returned from Mailchimp lists/subscribe submission.');
        }

        $this->statHat->ezCount('MB_Toolbox: MB_MailChimp: submitSubscribe', 1);

        return $results;
    }
public function submitSubscribe($listID, $composedItem = [])
    {

        $results = $this->mailChimp->call("lists/subscribe",
            [
                'id' => $listID,
                'email' => [
                    'email' => $composedItem['email']['email']
                ],
                'merge_vars' => $composedItem['merge_vars'],
                'double_optin' => false,
                'update_existing' => true,
                'replace_interests' => false,
                'send_welcome' => false,
            ]);

        // Trap errors
        if (isset($results['error'])) {
            throw new Exception('Call to lists/subscribe returned error response: ' . $results['name'] . ': ' .  $results['error']);
        } elseif ($results == 0) {
            throw new Exception('Hmmm: No results returned from Mailchimp lists/subscribe submission.');
        }

        $this->statHat->ezCount('MB_Toolbox: MB_MailChimp: submitSubscribe', 1);

        return $results;
    }
public function submitSubscribe ( $ listID , $ composedItem = [ ] ) { $ results = $ this -> mailChimp -> call ( "lists/subscribe" , [ 'id' => $ listID , 'email' => [ 'email' => $ composedItem [ 'email' ] [ 'email' ] ] , 'merge_vars' => $ composedItem [ 'merge_vars' ] , 'double_optin' => false , 'update_existing' => true , 'replace_interests' => false , 'send_welcome' => false , ] ) ; // Trap errors if ( isset ( $ results [ 'error' ] ) ) { throw new Exception ( 'Call to lists/subscribe returned error response: ' . $ results [ 'name' ] . ': ' . $ results [ 'error' ] ) ; } elseif ( $ results == 0 ) { throw new Exception ( 'Hmmm: No results returned from Mailchimp lists/subscribe submission.' ) ; } $ this -> statHat -> ezCount ( 'MB_Toolbox: MB_MailChimp: submitSubscribe' , 1 ) ; return $ results ; }
Make single signup submission to MailChimp. Typically used for resubscribes.

@param string $listID
A unique ID that defines what MailChimp list the batch should be added to
@param array $composedItem
The the details of an email address to be submitted to MailChimp

@return array
A list of the RabbitMQ queue entry IDs that have been successfully
submitted to MailChimp.
Make single signup submission to MailChimp . Typically used for resubscribes .