我正在使用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密钥和列表ID是正确的。
为什么会这样?
答案 0 :(得分:2)
你必须把它放在输入名称中。目前你只把它作为类和id。
例如:
{{1}}