(emailSMSTemplates)
list- List all templates⚠️ Deprecatedrevert- Revert a template⚠️ Deprecatedget- Retrieve a template⚠️ DeprecatedtoggleTemplateDelivery- Toggle the delivery by Clerk for a template of a given type and slug⚠️ Deprecated
Returns a list of all templates. The templates are returned sorted by position.
⚠️ 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();
$response = $sdk->emailSMSTemplates->list(
templateType: Operations\TemplateType::Sms
);
if ($response->templateList !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateType |
Operations\TemplateType | ✔️ | The type of templates to list (email or SMS) |
?Operations\GetTemplateListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors16 | 400, 401, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Reverts an updated template to its default state
⚠️ 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();
$response = $sdk->emailSMSTemplates->revert(
templateType: Operations\RevertTemplatePathParamTemplateType::Email,
slug: '<value>'
);
if ($response->template !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateType |
Operations\RevertTemplatePathParamTemplateType | ✔️ | The type of template to revert |
slug |
string | ✔️ | The slug of the template to revert |
?Operations\RevertTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors19 | 400, 401, 402, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Returns the details of a template
⚠️ 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();
$response = $sdk->emailSMSTemplates->get(
templateType: Operations\PathParamTemplateType::Sms,
slug: '<value>'
);
if ($response->template !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateType |
Operations\PathParamTemplateType | ✔️ | The type of templates to retrieve (email or SMS) |
slug |
string | ✔️ | The slug (i.e. machine-friendly name) of the template to retrieve |
?Operations\GetTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors17 | 400, 401, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Toggles the delivery by Clerk for a template of a given type and slug.
If disabled, Clerk will not deliver the resulting email or SMS.
The app developer will need to listen to the email.created
or sms.created
webhooks in order to handle delivery themselves.
⚠️ 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\ToggleTemplateDeliveryRequestBody();
$response = $sdk->emailSMSTemplates->toggleTemplateDelivery(
templateType: Operations\ToggleTemplateDeliveryPathParamTemplateType::Sms,
slug: '<value>',
requestBody: $requestBody
);
if ($response->template !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
templateType |
Operations\ToggleTemplateDeliveryPathParamTemplateType | ✔️ | The type of template to toggle delivery for |
slug |
string | ✔️ | The slug of the template for which to toggle delivery |
requestBody |
?Operations\ToggleTemplateDeliveryRequestBody | ➖ | N/A |
?Operations\ToggleTemplateDeliveryResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors21 | 400, 401, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |