You are here

public function MailchimpLists::addSegmentMember in Mailchimp 8

Adds a member to a list segment.

Parameters

string $list_id: The ID of the list.

string $segment_id: The ID of the segment.

array $email: The email address to add to the segment.

array $parameters: Associative array of optional request parameters.

Return value

object

See also

http://developer.mailchimp.com/documentation/mailchimp/reference/lists/s...

File

lib/mailchimp-api-php/src/MailchimpLists.php, line 479

Class

MailchimpLists
Mailchimp Lists/Audiences library.

Namespace

Mailchimp

Code

public function addSegmentMember($list_id, $segment_id, $email, $parameters = []) {
  $tokens = [
    'list_id' => $list_id,
    'segment_id' => $segment_id,
  ];
  $parameters += [
    'email_address' => $email,
  ];
  return $this
    ->request('POST', '/lists/{list_id}/segments/{segment_id}/members', $tokens, $parameters);
}