Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Given a list, how do I obtain the groups for it and the subscribe to them? #58

Closed
shivamd opened this issue Sep 15, 2013 · 2 comments
Closed

Comments

@shivamd
Copy link

shivamd commented Sep 15, 2013

I have a list. That has multiple groups and each group has 2-3 groups. I want to get the first group and then the next group and subscribe to that. How can I obtain this with this api?

@rcarter
Copy link

rcarter commented Oct 17, 2013

Here's what I've found...

first you can grab the interest groupings by doing something like this (see: http://apidocs.mailchimp.com/api/2.0/lists/interest-groupings.php):

groupings_id = MAILCHIMP.lists.interest_groupings(id: ENV['MAILCHIMP_LIST_ID']).first["id"]

then you would do an updateMember and set the proper merge_vars...

    options = {
      "id" => 12345, # this is the list id
      "email" => {
        "email" => "example@email.com"
      },
      "merge_vars" => {
        "groupings" => [
          {
          "id" => groupings_id,
          "groups" => ['myGroup']
          }
        ]
      },
      "replace_interests" => 'true'
    }
    MAILCHIMP.lists.updateMember(options)

(see: http://apidocs.mailchimp.com/api/2.0/lists/update-member.php)

hope that gets you started at least...

@amro
Copy link
Owner

amro commented Oct 18, 2013

Thanks for answering, @rcarter.

@amro amro closed this as completed Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants