You are here

public function MailchimpLists::addMergeField in Mailchimp 8

Add merge field associated with a Mailchimp list.

Parameters

string $list_id: The ID of the list.

string $name: The name of the merge field.

string $type: The type for the merge field.

array $parameters: Associative array of optional request parameters.

Return value

object

See also

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

File

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

Class

MailchimpLists
Mailchimp Lists/Audiences library.

Namespace

Mailchimp

Code

public function addMergeField($list_id, $name, $type, $parameters = []) {
  $tokens = [
    'list_id' => $list_id,
  ];
  $parameters += [
    'name' => $name,
    'type' => $type,
  ];
  return $this
    ->request('POST', '/lists/{list_id}/merge-fields', $tokens, $parameters);
}