工作正常。这些组已创建。电子邮件订阅了这些组。但我不能插入名字和姓氏。
foreach($email as $batches){
$fname=$Subscriber['subscriber_firstname'];
$lname=$Subscriber['subscriber_lastname'];
$merge_vars =array(
'fname'=>$fname,
'lname'=>$lname,
'groupings'=>array(
array('id' =>$group_id,
'groups' =>array($group_name)
)
)
);
$batch[] = array('email'=>array('email' =>$batches), $merge_vars);
}
$subscriber = $Mailchimp_Lists -> batchSubscribe($listid,$batch, false, true, true);
print_r($batch);
答案 0 :(得分:0)
我遇到了同样的问题,发现mailchimp上的文档是错误的,你需要从字面上提供数组元素'MERGE_VARS'。
$batch[] = array(
'EMAIL' => array('email' => 'address@example.com'),
'MERGE_VARS' => array(
'FNAME' => 'First Name',
'LNAME' => 'Last Name'
)
);