(templates)
preview- Preview changes to a template⚠️ Deprecated
Returns a preview of a template for a given template_type, slug and body
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
use Clerk\Backend\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$requestBody = new Operations\PreviewTemplateRequestBody();
$response = $sdk->templates->preview(
templateType: '<value>',
slug: '<value>',
requestBody: $requestBody
);
if ($response->object !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateType |
string | ✔️ | The type of template to preview |
slug |
string | ✔️ | The slug of the template to preview |
requestBody |
?Operations\PreviewTemplateRequestBody | ➖ | Required parameters |
?Operations\PreviewTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors20 | 400, 401, 404, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |