======= <?php /** Get the list of sent campaign using the filter and paging limits, ordered by the name or date of the campaign. **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password $api = new BMEAPI($username, $password, $apiURL); if ($api->errorCode) { // an error occurred while logging in echo "code:" . $api->errorCode . "\n"; echo "msg :" . $api->errorMessage . "\n"; die; } $retval = $api->reportGet("", 1, 50, "", ""); if (!$retval) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo sizeof($retval) . " Reports Returned:\n"; echo "<table border=1>"; echo "<tr><td> </td><td>Email ID</td><td> Name </td><td> Is Segment </td>"; echo "<td> To List ID</td> <td> List Name </td> <td> Status </td>"; echo "<td> Created Date</td> <td> Modified Date</td></tr>"; foreach ($retval as $reportData) { echo "<tr>"; echo "<td>" . $reportData['sequence'] . "</td><td>" . $reportData['id'] . "</td>"; echo "<td> " . $reportData['emailName'] . "</td><td> " . $reportData['isSegment'] . "</td>"; echo "<td> " . $reportData['toListID'] . "</td><td>" . $reportData['toListName'] . "</td>";
======= <?php /** Get the email addresses which were opened in a given campaign,using the paging limits, ordered by the email or date of the opened record. **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password $api = new BMEAPI($username, $password, $apiURL); if ($api->errorCode) { // an error occurred while logging in echo "code:" . $api->errorCode . "\n"; echo "msg :" . $api->errorMessage . "\n"; die; } $campaignDetail = $api->reportGet("", 1, 2, "", ""); $emailID = $campaignDetail[0]['id']; $emailID = "2503"; $countryData = $api->reportGetOpenCountry($emailID); $CountryCode = $countryData[98]['country_region']; $retval = $api->reportGetOpenForCountry($emailID, $CountryCode); if (!$retval) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo sizeof($retval) . " Records Returned:\n"; echo "<table border=1>"; echo "<tr><td> </td><td> CountryRegionCode </td><td> State </td><td> Open Count </td></tr>"; foreach ($retval as $reportData) { echo "<tr>";
======= <?php /** Get the email statistics for a campaign **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password $api = new BMEAPI($username, $password, $apiURL); if ($api->errorCode) { // an error occurred while logging in echo "code:" . $api->errorCode . "\n"; echo "msg :" . $api->errorMessage . "\n"; die; } $campaignList = $api->reportGet("", 1, 10, "", ""); $emailIDs = $campaignList[0]['id'] . "," . $campaignList[1]['id'] . "," . $campaignList[2]['id']; $retval = $api->reportCompare($emailIDs); if (!$retval) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo "<table>"; foreach ($retval as $k => $v) { if (!is_array($v)) { echo "<tr><td>" . $k . "</td><td>" . $v . "</td></tr>"; } else { echo "<tr><td>" . $k . "</td><td>" . print_r($v) . "</td></tr>"; } }