listMergeVarUpdate()

Update of merge field parameters. It is not possible to change the type of merge field.

listMergeVarUpdate(string $id, string $tag, array $options) : boolean
Input parametrs
  • id - list ID
  • tag - merge field tag
  • options - settings of a field (see Adding new merge field for acceptable settings of a field)

Array of merge fields. Each merge field is represented as an array that includes:

  • true, if request for field update has succeeded.

Examples

mgapi_listMergeVarUpdate.php
 false,
    "name" => 'Merge Tag name',
    "default_value" => 'Default value',
    "show" => true
);
 
$retval = $api->listMergeVarUpdate($id, $tag, $options);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load listMergeVarUpdate()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "Returned: " . $retval . "\n";
}
xml-rpc_listMergeVarUpdate.php
 new xmlrpcval($apikey),
                    'id' => new xmlrpcval($listId),
                    'tag' => new xmlrpcval('MERGE_TAG'),
                    'options' => php_xmlrpc_encode(
                            array(
                                "req" => false,
                                "name" => 'Merge Tag name',
                                "default_value" => 'Default value',
                                "show" => true
                            )
                    )
                ),
                'struct');
$f = new xmlrpcmsg('listMergeVarUpdate', array($v));
$c = new xmlrpc_client($apiUrl["path"], $apiUrl['host'], 80);
$c->setDebug($debug);
$r = &$c->send($f);
 
header("Content-Type: text/plain");
if (!$r->faultCode()) {
    $retval = php_xmlrpc_decode($r->value());
    echo "Returned: " . $retval . "\n";
} else {
    echo "Unable to load listMergeVarUpdate()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
}
mgapi_listMergeVarUpdate.py
from lib.config import * #contains apikey
from lib.MGAPI import MGAPI
 
# This Example shows how to ping using the MGAPI.php class and do some basic error checking.
 
api = MGAPI(apikey)
 
id = listId
tag = 'MERGE_TAG'
options = {
    "req": False,
    "name": 'Merge Tag name',
    "default_value": 'Default value',
    "show": True
}
 
retval = api.listMergeVarUpdate(id, tag, options)
if api.errorCode:
    print "Unable to load listMergeVarUpdate()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
else:
    print "Returned: ", retval

© 2010-2017 Mailigen. All rights reserved.