You are here

public function MailChimp_ListsTest::staticSegmentMembersAdd in Mailchimp 7.3

See also

Mailchimp_Lists::staticSegmentMembersAdd()

File

tests/mailchimp_lists_test.inc, line 122
A virtual MailChimp Lists API implementation for use in testing.

Class

MailChimp_ListsTest

Code

public function staticSegmentMembersAdd($id, $seg_id, $batch) {
  $lists = $this
    ->loadLists();
  $response = array();
  if (isset($lists[$id])) {
    $response['success_count'] = 0;
    foreach ($batch as $batch_email) {
      if (isset($lists[$id]['data']['members'][$batch_email['email']])) {

        // No need to store this data, just increment success count.
        $response['success_count']++;
      }
    }
  }
  else {
    $response['status'] = 'error';
    $response['code'] = 200;
    $response['name'] = 'List_DoesNotExist';
  }
  return $response;
}