gpt4 book ai didi

javascript - Mailchimp 未收到名字和姓氏

转载 作者:行者123 更新时间:2023-12-02 14:37:15 25 4
gpt4 key购买 nike

我正在使用 Mailchimp api 自动填充列表。

<label class="ime"> </label>
<input class="subscriberequiredField subscribename" id="subscribename" type="text" value="Ime">
<label class="prezime"> </label>
<input class="subscriberequiredField subscribelastname" id="subscribelastname" type="type" value="Prezime">
<label class="mail"> E-mail</label>
<input class="subscriberequiredField subscribeemail" id="subscribeemail" name="subscribeemail" type="text" value="Email">
<input name="submit" type="submit" id="submit" value="SUBSCRIBE">

API:

<?php

require_once 'mailchimp/inc/MCAPI.class.php';
// MailChimp API Key
// MailChimp API Key ARTICLE at http://kb.mailchimp.com/accounts/management/about-api-keys#Finding-or-generating-your-API-key
$api = new MCAPI('api-key-is-here');
$merge_vars = array();

// MailChimp List IDb
// MailChimp List ID ARTICLE at http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
$retval = $api->listSubscribe( 'list-id-is-here', $_POST["subscribeemail"], $_POST["subscribename"], $_POST["subscribelastname"], $merge_vars, 'html', false, true );

?>

由于某种原因,$_POST["subscribename"] 和 $_POST["subscribelastname"] 无法访问列表。 API key 和列表 ID 正确。

为什么会发生这种情况?

最佳答案

您必须将其放入输入名称中。目前您仅将其作为类和 ID。

例如:

<input class="subscriberequiredField subscribename" name="subscribename" id="subscribename" type="text" value="Ime">

<input class="subscriberequiredField subscribelastname" name="subscribelastname" id="subscribelastname" type="type" value="Prezime">

关于javascript - Mailchimp 未收到名字和姓氏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37354373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com