Search code examples
phpformsapimailchimpnewsletter

How to disable Mailchimp double opt-in PHP


I'm totally new in Mailshimp stuff and I can't find anything on the web to disable the double opt-in. I don't use any Mailchimp API, I just have the form mailchimp gave me to put in my html.

Any idea without using the API or if I have to, by using the API ?

Thank you !


Solution

  •    require('Mailchimp.php');
       $api = new Mailchimp( $api_key );
    
       $result = $api->lists->subscribe( $api_key, $id,  $data['email'], $merge_vars, 'html', false );
    

    6th parameter defines that whether to disable the opt-in or not. Pass it as false will disable it.

    For more info refer:-http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php