emailReassignList
public static bool emailReassignList(string token, string emailID, array lists)
Reassign contact lists to the email.
Section
Email Campaign Related Methods

Parameters
string tokenA valid token for your account. To generate a token, use the login method.
string emailIDThe email ID to update. To get all the emails, use the emailGet method.
array listsThe array containing the list details.
integer segmentidThe segment ID (in case it is a segment). You can get the segment lists from segmentGet
integer listidThe contact list ID to whom this campaign is to be sent to. You can get the contact lists from listGet

Returns
boolReturns true if the targets were updated.


Examples
download example code
xmlrpc_emailReassignList.php


  1. <?php
  2. /**
  3. This Example shows how to authenticate a user using XML-RPC.
  4. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  5. **/
  6. require_once 'XML/RPC2/Client.php';
  7. require_once 'inc/config.php';
  8. $client = XML_RPC2_Client::create($apiURL);
  9. $token = $client->login($apiLogin, $apiPassword);
  10.  
  11. /**
  12. Fetch the latest segment, so we can retrieve the segment ID.
  13. **/
  14. $segmentList = $client->segmentGet($token, "", 1, 1, "");
  15. $segmentID = $segmentList[0]['id'];
  16.  
  17. /**
  18. Fetch the latest list, so we can retrieve the list ID.
  19. **/
  20. $contactList = $client->listGet($token, "", 1, 1, "", "");
  21. $listID = $contactList[0]['id'];
  22.  
  23. /**
  24. Fetch the latest email, so we can retrieve the email ID.
  25. **/
  26. $emailList = $client->emailGet($token, "", 1, 1, "", "");
  27. $emailID = $emailList[0]['id'];
  28.  
  29. $contacts[0]['segmentid'] = $segmentID;
  30. $contacts[1]['listid'] = $listID;
  31. $allOk = $client->emailReassignList($token, $emailID, $contacts);
  32. ?>