How to disable Mailchimp double opt-in PHP

断了今生、忘了曾经 提交于 2019-12-09 07:11:21

问题


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 !


回答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




回答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



来源:https://stackoverflow.com/questions/26013592/how-to-disable-mailchimp-double-opt-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!