【问题标题】:One list, two different thank you pages with MailchimpMailchimp 的一个列表,两个不同的感谢页面
【发布时间】:2013-03-24 06:11:39
【问题描述】:

Mailchimp 将每个表单绑定到一个列表。

我想在 Page1.html 上创建一个注册表单,将用户发送到 Page1ty.html,并在 Page2.html 上创建另一个表单,将用户发送到 Page2ty.html。但是两种形式都需要将用户输入到同一个列表中。如上所述,使用它们的基本形式是不可能的。我需要两个列表。

Mailchimp 说这种路由可能使用他们的 API 是可能的。有谁知道如何完成上述类型的注册?

【问题讨论】:

    标签: mailchimp


    【解决方案1】:

    您只需创建自定义表单并绑定到 MailChimp API,但在他们的最新更新中,您需要确保您拥有管理员权限。

    您从API downloads 中包含(要求)MCAPI.class.phpconfig.inc.php 文件,然后编写您的流程(我使用PHP)。

    下载文件并使用正确的凭据(API 密钥和列表 ID)设置您的“config.inc.php”文件后,您就可以开始了。

    这是PHP 中的一个示例,它为用户订阅了一个列表,但您必须阅读 API 文档才能获得您正在寻找的确切功能。

    <?php
    session_start();
    
    // ---  Sample fields - depends on your list
    $mailChimpTIME = date('Y-m-d H:i:s');
    $mailChimpFirstName = // First Name
    $mailChimpLastName = // Last Name
    $mailChimpEmailAddress = // Email Address
    
    require_once 'MCAPI.class.php';
    require_once 'config.inc.php'; //contains apikey
    
    $api = new MCAPI($apikey);
    
    $merge_vars = array(
    'FNAME'=>$mailChimpFirstName, 
    'LNAME'=>$mailChimpLastName, 
    'EMAIL'=>$mailChimpEmailAddress,
    'OPTIN_IP'=>$_SERVER['REMOTE_ADDR'], 
    'OPTIN_TIME'=>$mailChimpTIME
    );
    
    $email_type = 'html';
    $double_optin = true;
    $update_existing = true;
    $replace_interests = false;
    
    // By default this sends a confirmation email - you will not see new members
    // until the link contained in it is clicked!
    $retval = $api->listSubscribe( $listId, $mailChimpEmailAddress, $merge_vars, $email_type, $double_optin, $update_existing, $replace_interests);
    
    if ($api->errorCode){
        echo "Unable to load listSubscribe()!\n";
        echo "\tCode=".$api->errorCode."\n";
        echo "\tMsg=".$api->errorMessage."\n";
    } else {
        // Success
        //echo "Subscribed - look for the confirmation email!\n";
    }
    ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-09
      • 2017-11-04
      • 2019-08-31
      • 2015-06-13
      • 2020-01-28
      • 1970-01-01
      • 2017-12-15
      • 1970-01-01
      相关资源
      最近更新 更多