emailReassignList
public static bool emailReassignList(string token, string emailID, array lists)
Reassign contact lists to the email.
| Parameters |
| string token | A valid token for your account. To generate a token, use the login method. |
| string emailID | The email ID to update. To get all the emails, use the emailGet method. |
| array lists | The array containing the list details.
| integer segmentid | The segment ID (in case it is a segment). You can get the segment lists from segmentGet | | integer listid | The contact list ID to whom this campaign is to be sent to. You can get the contact lists from listGet |
|
| Returns |
| bool | Returns true if the targets were updated. |
- <?php
- /**
- This Example shows how to authenticate a user using XML-RPC.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.php';
- $client = XML_RPC2_Client::create($apiURL);
- $token = $client->login($apiLogin, $apiPassword);
-
- /**
- Fetch the latest segment, so we can retrieve the segment ID.
- **/
- $segmentList = $client->segmentGet($token, "", 1, 1, "");
- $segmentID = $segmentList[0]['id'];
-
- /**
- Fetch the latest list, so we can retrieve the list ID.
- **/
- $contactList = $client->listGet($token, "", 1, 1, "", "");
- $listID = $contactList[0]['id'];
-
- /**
- Fetch the latest email, so we can retrieve the email ID.
- **/
- $emailList = $client->emailGet($token, "", 1, 1, "", "");
- $emailID = $emailList[0]['id'];
-
- $contacts[0]['segmentid'] = $segmentID;
- $contacts[1]['listid'] = $listID;
- $allOk = $client->emailReassignList($token, $emailID, $contacts);
- ?>