1. Go to this page and download the library: Download markuszeller/cleverreach library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
markuszeller / cleverreach example snippets
use markuszeller\CleverReach\ApiManager;
use markuszeller\CleverReach\Http\Guzzle as HttpAdapter;
// Create an HTTP adapter
$httpAdapter = new HttpAdapter();
// Authorize your app by credentials
$response = $httpAdapter->authorize('<CLIENT_ID>', '<CLIENT_SECRET>');
if (isset($response['access_token'])) {
// Persist the access token for later use...
}
use markuszeller\CleverReach\ApiManager;
use markuszeller\CleverReach\Http\Guzzle as HttpAdapter;
// Create an HTTP adapter
$httpAdapter = new HttpAdapter(
[
'access_token' => '<ACCESS_TOKEN>',
]
);
// Create the API manager
$apiManager = new ApiManager($httpAdapter);
// Get a list of all Mailings
// You can provide a state, i.e. draft
$mailings = $apiManager->getMailings(0, ApiManager::MAILING_STATE_DRAFT);
// Get a specific Mailing
// returns a Mailing Object
$mailing = $apiManager->getMailing(MAILING_ID);
// Get Specific Mailing details
$mailingLinks = $apiManager->getMailingLinks(MAILING_ID);
$mailingOrders = $apiManager->getMailingOrders(MAILING_ID);
$mailingChannels = $apiManager->getMailingChannels();
$mailingChannel = $apiManager->getMailingChannel(CHANNEL_ID);
// Read one for updating
$mailing = $apiManager->getMailing(MAILING_ID);
// Create a fresh Mailing and Content instance with no data
$updatedMailing = new Mailing(MAILING_ID);
$content = new MailingContent();
// Get HTML content from "old"
$html = $mailingData->getContent()->getHtml();
// Inject a update message after body tag
$date = date(DATE_W3C);
$html = preg_replace("/(<body.*
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.