- Issue created by @dabley
- Status changed to Closed: works as designed
about 1 year ago 1:30pm 20 October 2023 - 🇨🇦Canada sagesolutions
The way to intialize the MailchimpLists has changed in version 3.0 - see https://github.com/thinkshout/mailchimp-api-php
See https://www.drupal.org/project/mailchimp/issues/3395363#comment-15282064 🐛 Error: Call to a member function request() on string in Mailchimp\MailchimpLists->getMemberInfo() Closed: works as designed as an example, but the following should work for your scenario
// Instantiate MailchimpApiInterface $authentication_settings = [ 'api_key' => 'YOUR_API_KEY', 'api_user' => 'api_key', ]; // Use Mailchimp class for api_key. $api_class = new Mailchimp($authentication_settings); $mc = new Mailchimp\MailchimpLists($api_class); $list_id='abc'; $segments = $mc->getSegments($list_id);
Thanks @sagesolutions, this now works for me (after I'd added "use Mailchimp\Mailchimp;")