<?php // Include the api wrapper include_once './rmapi.class.php'; // Initialize the rmapi class // your token can be generated from the User Interface at https://go.reachmail.net // log in, got to the Account Tab -> Tokens to generate your access token $rmapi = new RMAPI('YoUrSeCr3tTokenG03sH3rE'); // Retrieve account information array $account_info = $rmapi->rm_administrationUsersCurrent(); // Parse array and access the account id stdClass object value. // Returns just the the account GUID as a string $AccountId = $account_info['service_response']->AccountId; // Due to PHP's lack of dictionary objects, each recipient must be placed in // their own single record array $request = array("FromAddress" => "*****@*****.**", "Recipients" => array(array("Address" => "*****@*****.**"), array("Address" => "*****@*****.**")), "Subject" => "Test Subject", "Headers" => array("From" => "FromName <*****@*****.**>", "X-Company" => "ReachMail"), "BodyText" => "This is the TEXT version of the Easy-SMTP API test", "BodyHtml" => "This is the HTML version of the \n <a href=\"http://www.easy-smtp.com\">Easy-SMTP</a> \n API test", "Tracking" => true); // Send the message and store the response in a variable for easy access. $es_campaign = $rmapi->rm_easySmtpDelivery($AccountId, $request);
<?php #include the api wrapper include_once 'rmapi.class.php'; #initialize the rmapi class $rmapi = new RMAPI('YoUrSeCr3tTokenG03sH3rE'); #retrieve account information array $account_info = $rmapi->rm_administrationUsersCurrent(); #parse array and access the account id stdClass object value. returns just the the account GUID as a string $AccountId = $account_info['service_response']->AccountId; #Dates are in UTC format and must be set as strings $startdate = '2014-09-20T00:00:00.000Z'; $enddate = '2014-09-29T00:00:00.000Z'; $es_Opens = $rmapi->rm_reportsEasySMTPOpens($AccountId, $startdate, $enddate);
<?php include_once '/path/To/Wrapper/rmapi.class.php'; # initilize class $rmapi = new RMAPI('YourSecrEtTokenGo3sHeRe'); #request AccountID $account_info = $rmapi->rm_administrationUsersCurrent(); #parse array and access the account id stdClass object value. returns just the the account GUID as a string $AccountId = $account_info['service_response']->AccountId; #Build the request array For details on the potential filers, see here: https://services.reachmail.net/#Reports@/reports/mailings/summary $request = array("ScheduledDeliveryOnOrAfter" => "2016-03-20T05:21:00.0000000Z", "ScheduledDeliveryOnOrBefore" => "2016-03-30T05:21:00.0000000Z"); # Pull Report Summary $reportSummary = $rmapi->rm_reportsMailingsSummary($AccountId, $request); #print results to screen print_r($reportSummary);