emailGet
public static array emailGet(string token, string filter, integer pageNumber, integer pageSize, string orderBy, string sortOrder)
Get the list of emails using the filter and paging limits, order by the name or date of the email.
Parameters
|
string token | A valid token for your account. To generate a token, use the login method. |
string filter | Show emails where the email name starts with the filter |
string status | Fetch emails matching a status(-1 = All, 0 = Draft, 1 = Scheduled, 2 = Sent) |
integer pageNumber | Fetch results from the given page number. |
integer pageSize | Number of results per page. |
string orderBy | Sort the results based on "name" or "date". |
string sortOrder | Sort the results in the "asc"ending or "desc"ending order. |
Returns |
array | Returns an array with the results. |
Return Structure |
integer sequence | The sequence number of the record |
string id | The ID of the email campaign. To get the details of this campaign, use the emailGetDetail method. |
string emailName | Name of the email campaign |
string fromName | The from name that appears in the recipients inbox |
string subject | The subject line of the email |
integer toListID | The ID of the target contact list |
string toListName | The name of the target contact list |
string status | The status of the email. Can be 'Draft', 'Scheduled', 'Sent', 'Incomplete' |
string createdDate | The date on which the list was created |
string modifiedDate | The date on which the list was last 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);
- $emailLists = $client->emailGet($token, "", "", 1, 100, "", "");
-
- foreach($emailLists as $rec) {
- echo $rec['sequence'] . "] Email Name: " . $rec['emailName'] . "(" . $rec['id'] . ")";
- echo "\t To List:" . $rec['toListName'] . "(" . $rec['toListID'] . ")";
- echo "\t Subject:" . $rec['subject'] ;
- echo "\t Status:" . $rec['status'] ;
- echo "\t Created Date: " . $rec['createdDate'] ;
- echo "\t Updated Date: " . $rec['modifiedDate'];
- echo "<br />";
- }
-
- ?>