How to disable Mailchimp double opt-in PHP

14,572

Solution 1

   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

Solution 2

Thx Garima but this is for API 1.3. There is API 2.0 now.

So you can use this snippet https://github.com/drewm/mailchimp-api

This is the simplest way to use the mailchimp API I think. Then like you said, you turn to false the double opt_in parameter.

http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php

Have A Good Day

Share:
14,572
KeizerBridge
Author by

KeizerBridge

Updated on June 17, 2022

Comments

  • KeizerBridge
    KeizerBridge almost 2 years

    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 !

  • Garima
    Garima over 9 years
    @KeizerBridge :- Thanks for pointing out. I have edit the code, so that it can be beneficial for others.