[英]How do I pull the subscriber count from a MailChimp list with the API?
[英]How do you subscribe and assign subscriber to group with the mailchimp api?
我正在嘗試使用PHP中的API來訂閱並將訂閱者分配給組。
我需要能夠即時創建該小組,並且我正在嘗試類似以下的嘗試,但並沒有取得太大的成功:
// include other relevant files here
$merge_vars = array(
'FNAME'=>$name[0],
'LNAME'=>$name[1],
'INTERESTS'=>'',
'GROUPINGS'=>'Pets'
);
如果我從數組中刪除“分組”,那么訂閱工作就很好了,所以我們已經做到了……但是如何進行分組呢?
謝謝你的時間
我知道這有點晚了,但是我認為這可能會對其他人有所幫助。
$merge_vars = array(
'GROUPINGS' => array(
0 => array(
'id' => "101", //You have to find the number via the API
'groups' => "Interest Name 1, Interest Name 2",
)
)
);
然后,您可以使用listUpdateMember()
方法將現有訂戶添加到興趣組。
// Then use listUpdateMember to add them
$objMailChimp->listUpdateMember($listID, $email, $merge_vars));
在數組中再添加1個內容,即“ EMAIL” =>“ test@test.com”
&,當您調用listSubscribe()時,請檢查您的
apiKey,listId,
“要添加到訂戶列表中的電子郵件ID在此處,即test@test.com”,EMAIL_TYPE字段正確。
嘗試這個。 這將對您有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.