简体   繁体   English

Mailchimp API v1.1 listUpdateMember如何发送复选框字段?

[英]Mailchimp api v1.1 listUpdateMember how to send checkbox fields?

Ok I know it's dated but it's a legacy plugin I need to update. 好的,我知道它已过时,但这是我需要更新的旧版插件。

I am trying to use the listUpdateMember to update a checkbox field in mailchimp. 我正在尝试使用listUpdateMember更新mailchimp中的复选框字段。 I have the normal merge_vars updating FNAME, LNAME etc but the GROUPINGS one does nothing and returns no errors. 我有正常的merge_vars更新FNAME,LNAME等,但是GROUPINGS却不执行任何操作,也不返回任何错误。 My last attempt at this was to create a manual array 我对此的最后尝试是创建一个手动数组

$group = [array('id' => '3525', 'name' => 'Interests', 'groups' => array('General', 'Education'))];

Assign this to $merge_vars['GROUPINGS'] and then send it via the created api 将此分配给$merge_vars['GROUPINGS'] ,然后通过创建的api发送

$api->listUpdateMember($listId, $email, $merge_vars);

As I said the other fields get updated but not the interests checkbox group. 正如我所说,其他字段会更新,但兴趣复选框组不会更新。

So my main problem is knowing what the GROUPINGS variable is expecting as an array if someone could set it out as a php array I can then re-create this from my form fields. 所以我的主要问题是,如果有人可以将GROUPINGS变量作为数组期望,那么我可以从表单字段中重新创建它。

Any help much appreciated. 任何帮助,不胜感激。

Eventually worked this out myself after lots of head scratching not helped by an annoying browse cache! 最终,在烦人的浏览缓存无济于事之后,我自己解决了这个问题!

'GROUPINGS'=>array(
                array( 'groups' => 'comma, separated, list, of, options', 'id' => '[groupId]' )   
            )

[groupId] can be found by calling yourApiModel->listInterestGroupings($listId) 可以通过调用yourApiModel-> listInterestGroupings($ listId)来找到[groupId]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM