PHP SDK

Composer package for rendering templates from PHP applications and CMS plugins.

Install

bash
composer require commspliant/sdk

Links

Quickstart

Render an approved template to HTML:

php
<?php

use CommsPliant\Client;
use CommsPliant\RenderRequest;

$client = new Client('ck_YOUR_API_KEY');

$result = $client->renderHtml(new RenderRequest(
    templateId: '550e8400-e29b-41d4-a716-446655440000',
    variables: [
        'title' => 'Monthly Report',
        'user' => ['name' => 'Jane Doe'],
    ],
));

file_put_contents('document.html', $result->body);

API endpoints

The SDK supports both Customer Integration API render endpoints:

Use renderHtml / renderPdf (or language-specific naming) on the client. See the GitHub repository for full documentation and PDF examples.

Back to SDK overview