KeizerBridge
KeizerBridge

Reputation: 2757

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 !

Upvotes: 2

Views: 14679

Answers (2)

Garima
Garima

Reputation: 174

   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

Upvotes: 5

KeizerBridge
KeizerBridge

Reputation: 2757

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

Upvotes: 1

Related Questions