Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MailChimp API 1.3 + Hominid 3 + Groupings

Tags:

ruby

mailchimp

For some reason I just can't get the latest version of Hominid working with groupings in MailChimp.

Here's a snippet of what I'm doing:

info[:GROUPINGS] = { 'name' => 'Locations', 'groups' => 'SomeLocation' }    
mailchimp = Hominid::API.new(MAILCHIMP_API_KEY)
list_id = mailchimp.find_list_id_by_name MAILCHIMP_LIST_NAME
mailchimp.list_update_member(list_id, email_value, info)

I've tried seemingly every combination of arrays and hashes to get the groupings working, but I keep getting variations of this error:

<270> "V" is not a valid Interest Grouping id for the list: Test List

Any help would be appreciated!

like image 756
Tim Sullivan Avatar asked Jan 21 '23 18:01

Tim Sullivan


1 Answers

It seems that it needs an array of hashes:

info[:GROUPINGS] = [ { 'name' => 'Locations', 'groups' => 'SomeLocation' } ]

I hope this helps someone!

like image 129
Tim Sullivan Avatar answered Jan 31 '23 06:01

Tim Sullivan