<?php /** This Example shows how to get the list of existing Emails **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password //This hack actually skips the login and lets you choose the API Key to expire. $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; } $emailLists = $api->emailGet("", "", 1, 10, "", ""); $emailID = $emailLists[0]['id']; $HtmlContent = "<html><body>hello</body></html>"; $TextContent = "Buy our product and get Profit"; $emailAddress = "*****@*****.**"; $email = array(); $email = $api->emailPreview($emailID, $emailAddress, $HtmlContent, $TextContent); if (!$email) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo $email['sequence'] . ")" . $email['emailName']; echo "From:-" . $email['fromEmail']; echo "From Name:-" . $email['fromName']; echo "Template:-" . $email['templateContent'];
?> ======= <?php /** This Example shows how to get details of an existing Email **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password //This hack actually skips the login and lets you choose the API Key to expire. $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; } $emailStructure = $api->emailGet("", -1, 1, 5, "", ""); $emailID = $emailStructure[0]['id']; $newName = "Welcome"; $retval = $api->emailCheckName($emailID, $newName); if (!$retval) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo $retval; } ?> >>>>>>> 250a993699aa8885e23578fdfcdb6d486f7dbfae
<?php /** This Example shows how to get the list of existing Emails **/ require_once 'inc/BMEAPI.class.php'; require_once 'inc/config.php'; //contains username & password //This hack actually skips the login and lets you choose the API Key to expire. $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->emailGet("", -1, 1, 5, "", ""); if (!$retval) { echo "Error!"; echo "\n\tCode=" . $api->errorCode; echo "\n\tMsg=" . $api->errorMessage . "\n"; } else { echo sizeof($retval) . " Emails Returned:\n"; echo "<table>"; echo "<tr><td>Email ID</td><td> Name </td><td> From Name </td><td> Subject </td><td> List ID </td><td> List Name </td>"; echo "<td> Status </td><td> Created Date</td> <td> Modified Date</td></tr>"; foreach ($retval as $emailData) { echo "<tr>"; echo "<td>" . $emailData['id'] . "</td><td>" . $emailData['emailName'] . "</td>"; echo "<td>" . $emailData['fromName'] . "</td><td>" . $emailData['subject'] . "</td>"; echo "<td>" . $emailData['toListID'] . "</td><td>" . $emailData['toListName'] . "</td>"; echo "<td>" . $emailData['status'] . "</td>";