Posted by rubyone11 on September 18, 2012 at 9:19pm
4 followers
Jump to:
| Project: | MailChimp |
| Version: | 7.x-2.x-dev |
| Component: | General |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
The mailchimp_get_list and mailchimp_get_lists() functions do not return $list as an object that can be used to programmatically add subscribers. Developers need to manually/programmatically cast the return value from this function to an (object) in order to submit to mailchimp_subscribe_user.
Furthermore, developer needs to add mc_list_id field and label field, as well, in order for mailchimp_subscribe_user to return success.
I think that mailchimp_get_list should return an object that should be compatible with the mailchimp_subscribe_user function.
Comments
#1
subscribe.
#2
Better title/version.
#3
mailchimp_get_lists is asking the mailchimp API for its lists & associated data: the API gives us back some arrays, and those are what mailchimp_get_lists returns: a rich data about the lists on your MailChimp instance.
mailchimp_subscribe_user doesn't take a Mailchimp list as an argument: it takes a mailchimp_lists drupal object created by the mailchimp_lists module. One of the properties on such an object is "mc_list_id". That points to the kind of list that mailchimp_get_lists is returning. This allows us to control the behavior based on various list-specific settings.
It sound like you are working outside the functionality of the mailchimp_lists module, or using mailchimp_get_lists in a way other than intended. Perhaps you want mailchimp_lists_get_available_lists?