不工作Mailchimp double_optin选项 [英] Mailchimp double_optin option not working

查看:177
本文介绍了不工作Mailchimp double_optin选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照本教程实施在我的网站mailchimp API 2.0版。
它的伟大工程,但在 double_optin 选项,我想添加和设置为(使用户不需要通过电子邮件,以验证其注册)没有按'不像是会奏效。这就像如果它没有考虑到在所有的,用户仍然需要通过电子邮件验证登记。

'double_optin'=>假放置在错误的地方?我看了一下 mailchimp文档但我在programmation水平不是很好足以确定哪些是错的。
感谢您的帮助。

 < PHP
$ API_KEY =12345486-US8$ LIST_ID =123;需要('Mailchimp.php');
$ Mailchimp =新Mailchimp($ API_KEY);
$ Mailchimp_Lists =新Mailchimp_Lists($ Mailchimp);
$用户= $ Mailchimp_Lists->认购($ LIST_ID,阵列(电子邮件= GT;ヶ辆($ _ POST [电子邮件]),double_optin'=> FALSE));如果(!空($用户['LEID'])){
   回声成功;
}
其他
{
    回声不及格;
}?>


解决方案

根据这个(当然非官方看)的 Mailchip_Lists文档,你要通过 FALSE 作为第五个参数为<一个href=\"http://www.avignyata.com/fbtesting/mailchimp-api/docs/source-class-Mailchimp_Lists.html#698-735\"相对=nofollow>订阅()。

例如:

  $ double_optin = FALSE;$用户= $ Mailchimp_Lists-&GT;认购(
    $ LIST_ID,
    阵列('邮件'= GT;ヶ辆($ _ POST [电子邮件]))
    NULL,// merge_vars
    'HTML',// EMAIL_TYPE
    $ double_optin
);

I've followed this tutorial to implement mailchimp API v2.0 on my website. It works great, however the double_optin option that I wanted to add and set to false (so that users don't need to validate their registration via e-mail) doesn't seem to be working. It's like if it was not taken into consideration at all, users still need to validate the registration via e-mail.

Is 'double_optin' => false placed at the wrong place? I had a look at mailchimp documentation but my level in programmation is not good enough to identify what is wrong. Thanks for your help

<?php
$api_key = "12345486-us8";

$list_id = "123";

require('Mailchimp.php');
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
$subscriber = $Mailchimp_Lists->subscribe( $list_id, array( 'email' => htmlentities($_POST['email']),'double_optin' => false ) );

if ( ! empty( $subscriber['leid'] ) ) {
   echo "success";
}
else
{
    echo "fail";
}

?>

解决方案

According to this (admittedly unofficial-looking) Mailchip_Lists documentation, you'll want to pass FALSE as the 5th parameter to subscribe().

Example:

$double_optin = FALSE;

$subscriber = $Mailchimp_Lists->subscribe(
    $list_id,
    array('email' => htmlentities($_POST['email'])),
    NULL, // merge_vars
    'html', // email_type
    $double_optin
);

这篇关于不工作Mailchimp double_optin选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆