Emails from the selected list are deleted. Array of recipients’ emails with additional parameters are passed, which determine whether a message/notification about email removal will or will not be sent to this particular email.
listBatchUnsubscribe(string $id, array $emails, boolean $delete_member, boolean $send_goodbye, boolean $send_notify) : struct
Array consisting of:
listBatchUnsubscribe($id, $emails, $delete_member, $send_goodbye, $send_notify); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load listBatchUnsubscribe()!\n"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { echo "success:" . $retval['success_count'] . "\n"; echo "errors:" . $retval['error_count'] . "\n"; foreach ($retval['errors'] as $val) { echo "\t*" . $val['email'] . " failed\n"; echo "\tcode:" . $val['code'] . "\n"; echo "\tmsg :" . $val['message'] . "\n\n"; } }
new xmlrpcval($apikey), 'id' => new xmlrpcval($listId), 'emails' => php_xmlrpc_encode(array($my_email, $boss_man_email)), 'delete_member' => new xmlrpcval(false), 'send_goodbye' => new xmlrpcval(true), 'send_notify' => new xmlrpcval(false) ), 'struct'); $f = new xmlrpcmsg('listBatchUnsubscribe', 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 "success:" . $retval['success_count'] . "\n"; echo "errors:" . $retval['error_count'] . "\n"; foreach ($retval['errors'] as $val) { echo "\t*" . $val['email'] . " failed\n"; echo "\tcode:" . $val['code'] . "\n"; echo "\tmsg :" . $val['message'] . "\n\n"; } } else { echo "Unable to load listBatchUnsubscribe()!"; echo "\tCode=" . $r->faultCode() . "\n"; echo "\tMsg=" . $r->faultString() . "\n"; }
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; emails = [my_email, boss_man_email] delete_member = False send_goodbye = True send_notify = False retval = api.listBatchUnsubscribe(id, emails, delete_member, send_goodbye, send_notify) if api.errorCode: print "Unable to load listBatchUnsubscribe()!" print "\tCode=", api.errorCode print "\tMsg=", api.errorMessage else: print "success:", retval['success_count'] print "errors:", retval['error_count'] for val in retval['errors']: print "\t*", val['email'], " failed" print "\tcode:", val['code'] print "\tmsg :", val['message']