You are here

public function MailchimpLists::addSegment in Mailchimp 8

Same name in this branch
  1. 8 lib/mailchimp-api-php/src/MailchimpLists.php \Mailchimp\MailchimpLists::addSegment()
  2. 8 lib/mailchimp-api-php/tests/src/MailchimpLists.php \Mailchimp\Tests\MailchimpLists::addSegment()

Adds a new segment to a Mailchimp list.

Parameters

string $list_id: The ID of the list.

string $name: The name of the segment.

array $parameters: Associative array of optional request parameters.

bool $batch: TRUE to create a new pending batch operation.

Return value

object

See also

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

1 call to MailchimpLists::addSegment()
MailchimpLists::addSegment in lib/mailchimp-api-php/tests/src/MailchimpLists.php
@inheritdoc
1 method overrides MailchimpLists::addSegment()
MailchimpLists::addSegment in lib/mailchimp-api-php/tests/src/MailchimpLists.php
@inheritdoc

File

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

Class

MailchimpLists
Mailchimp Lists/Audiences library.

Namespace

Mailchimp

Code

public function addSegment($list_id, $name, $parameters = [], $batch = FALSE) {
  $tokens = [
    'list_id' => $list_id,
  ];
  $parameters += [
    'name' => $name,
  ];
  return $this
    ->request('POST', '/lists/{list_id}/segments', $tokens, $parameters, $batch);
}