MessageTemplates
in package
Client operations for Inttegro message templates.
Request arrays use the API's documented snake_case field names. Responses
are returned as immutable values from the corresponding singular namespace.
Table of Contents
Methods
- __construct() : mixed
- Creates the message templates resource client.
- archive() : MessageTemplate
- Archives the message template.
- create() : MessageTemplate
- Creates a new message template.
- lookup() : MessageTemplate
- Retrieves the requested message template.
- page() : Page
- Retrieves a paginated collection of message templates.
- publish() : MessageTemplate
- Publishes the message template.
- renderPreview() : Preview
- Performs the `renderPreview` operation for the message template.
- update() : MessageTemplate
- Updates the supplied fields on the message template.
Methods
__construct()
Creates the message templates resource client.
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
-
Shared authenticated HTTP transport used by this resource client.
archive()
Archives the message template.
public
archive(string $templateId[, string|null $idempotencyKey = null ]) : MessageTemplate
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $templateId : string
-
Unique identifier of the template.
- $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
MessageTemplate —The archived message template.
create()
Creates a new message template.
public
create(array<string, mixed> $payload[, string|null $idempotencyKey = null ]) : MessageTemplate
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed>
-
Request fields keyed by the documented
snake_caseAPI names. - $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
MessageTemplate —The created message template.
lookup()
Retrieves the requested message template.
public
lookup(string $templateId) : MessageTemplate
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $templateId : string
-
Unique identifier of the template.
Return values
MessageTemplate —The requested message template.
page()
Retrieves a paginated collection of message templates.
public
page([array<string, mixed> $payload = [] ]) : Page
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed> = []
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
Page —A typed page of matching message templates.
publish()
Publishes the message template.
public
publish(string $templateId[, string|null $idempotencyKey = null ]) : MessageTemplate
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $templateId : string
-
Unique identifier of the template.
- $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
MessageTemplate —The resulting message template.
renderPreview()
Performs the `renderPreview` operation for the message template.
public
renderPreview(array<string, mixed> $payload) : Preview
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed>
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
Preview —The resulting preview.
update()
Updates the supplied fields on the message template.
public
update(array<string, mixed> $payload[, string|null $idempotencyKey = null ]) : MessageTemplate
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed>
-
Request fields keyed by the documented
snake_caseAPI names. - $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
MessageTemplate —The updated message template.