You are here

function MCAPI::listMergeVarAdd in Mailchimp 6.2

Same name and namespace in other branches
  1. 5.2 MCAPI.class.php \MCAPI::listMergeVarAdd()
  2. 5 MCAPI.class.php \MCAPI::listMergeVarAdd()
  3. 6 MCAPI.class.php \MCAPI::listMergeVarAdd()
  4. 7 MCAPI.class.php \MCAPI::listMergeVarAdd()

Add a new merge tag to a given list

Related

@example xml-rpc_listMergeVarAdd.php

Parameters

string $id the list id to connect to. Get by calling lists():

string $tag The merge tag to add, e.g. FNAME:

string $name The long description of the tag being added, used for user displays:

array $req optional Various options for this merge var. <em>note:</em> for historical purposes this can also take a "boolean": string field_type optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl - defaults to text boolean req optional indicates whether the field is required - defaults to false boolean public optional indicates whether the field is displayed in public - defaults to true boolean show optional indicates whether the field is displayed in the app's list member view - defaults to true string default_value optional the default value for the field. See listSubscribe() for formatting info. Defaults to blank array choices optional kind of - an array of strings to use as the choices for radio and dropdown type fields

Return value

bool true if the request succeeds, otherwise an error will be thrown

File

./MCAPI.class.php, line 1061

Class

MCAPI

Code

function listMergeVarAdd($id, $tag, $name, $req = array()) {
  $params = array();
  $params["id"] = $id;
  $params["tag"] = $tag;
  $params["name"] = $name;
  $params["req"] = $req;
  return $this
    ->callServer("listMergeVarAdd", $params);
}