dongyongyin5339 2014-05-29 19:51
浏览 43
已采纳

Mailchimp 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";
}

?>
  • 写回答

1条回答 默认 最新

  • dqyl2374 2014-05-29 20:14
    关注

    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
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题