2010-09-28 37 views
1

我正在嘗試在PHP中使用API​​訂閱並將訂戶分配給組。你如何訂閱和分配用戶與mailchimp api組?

我需要能夠在飛行中創建組和我試圖像沒有太大的成功,以下內容:

// include other relevant files here 

$merge_vars = array(
    'FNAME'=>$name[0], 
    'LNAME'=>$name[1], 
    'INTERESTS'=>'', 
    'GROUPINGS'=>'Pets' 
); 

如果刪除該數組中的「分組」,預定工作得很好 - 所以我們已經開始了......但我們如何做團隊?

感謝您的時間

回答

0

陣列中添加1更多的東西,即 「EMAIL」=> 「[email protected]

當你調用listSubscribe

&()檢查

apiKey, listId,

「要添加到用戶列表中的電子郵件ID來到這裏,即[email protected]」, EMAIL_TYPE字段正確。

試試這個。這對你有幫助。

1

我知道這有點晚了,但我想這可能會幫助別人。

$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)); 
相關問題