<?php
//client can de downloaded from https://github.com/Newsman/newsman-api-php
require_once("Newsman/Client.php");
// you can get your API KEY, your newsman_user_id and list_id from My account -> API
$newsman_user_id = "your-username";
$api_key = "your-api-key";
$list_id = "my_list_id"; // The ID of the list in which the draft is present
$draft_id = "my_draft_id"; // The ID of the draft for which to get the info
$compile_params = array("param" => "value"); // The parameters for the Handlebars compilation of the HTML code
try {
$client = new Newsman_Client($newsman_user_id, $api_key);
$ret = $client->draft->getParseDraftHTMLHandlebars($list_id, $draft_id, $compile_params);
} catch (Exception $e) {
//do something with the error, eg: log $e->getMessage()
}
return $ret;
?>