Skip to content

Instantly share code, notes, and snippets.

@jonathanmaron
Last active October 23, 2018 10:32
Show Gist options
  • Save jonathanmaron/4a12a8aae67e6b3c64357e20a771043b to your computer and use it in GitHub Desktop.
Save jonathanmaron/4a12a8aae67e6b3c64357e20a771043b to your computer and use it in GitHub Desktop.
<?php
use TxTextControl\ReportingCloud\ReportingCloud;
$reportingCloud = new ReportingCloud([
'api_key' => Helper::apiKey(),
]);
$templateName = 'sample_invoice.tx';
$binaryData = $reportingCloud->downloadTemplate($templateName);
$destinationFilename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $templateName;
file_put_contents($destinationFilename, $binaryData);
var_dump("{$templateName} was written to {$destinationFilename}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment