我正在尝试将表单中的 $POST_[values] 推送到我的 Mailchimp 联系人列表中,但我可以推送的唯一两个值是“电子邮件”和“状态”(即“订阅”)。
我阅读了所有文档,但无法使用提供的合并字段。
HTML
<div class="input-box">
<span>First Name</span>
<input type="text" name="FNAME" value="FNAME" tabindex="1">
</div>
<div class="input-box">
<span>Last Name</span>
<input type="text" name="LNAME" value="LNAME" tabindex="2">
</div>
<div class="input-box">
<span>Email*</span>
<input type="email" name="email2" tabindex="3" required>
</div>
<div class="input-box">
<span>Company*</span>
<input type="text" tabindex="4" name="MMERGE9" value="MMERGE9" required>
</div>
<input id="submit-download" type="submit" name="submit2" tabindex="5" disabled></input>
PHP
include('./mailchimp/MailChimp.php');
$MailChimp = new MailChimp('XXXX');
$list_id = 'XXX';
$email = $_POST['email2'];
$MERGE9 = $_POST['MMERGE9'];
$result = $MailChimp->post("lists/$list_id/members", [
'email_address' => $email,
'status' => 'subscribed',
'MERGE9' => $MERGE9,
我尝试了 Mailchimp 提供的所有变体:MERGE9、MMERGE9、|MERGE9|
我使用这个库:https ://github.com/drewm/mailchimp-api
我还尝试使用 curl 命令列出合并字段,但无法正常工作: