MessageTemplate
extends DomainValue
in package
A reusable SMS or email template, including its variables, content, safety results, and lifecycle state.
This immutable value hydrates decoded API snake_case data into typed camelCase properties.
Use fromArray() for wire data; toArray(), array access, and JSON serialization expose the API
wire representation. Nullable properties correspond to optional API fields.
Tags
Table of Contents
Properties
- $about : string|null
- Additional explanatory text.
- $archivedAt : DateTimeImmutable|null
- Time at which the value was archived.
- $attachments : GenericValue|null
- Stored file IDs returned by previews. Chime send, schedule, and broadcast currently reject stored-template attachments.
- $channel : string
- Channel value for this message template.
- $createdAt : DateTimeImmutable
- Time at which the value was created.
- $draftVersion : int
- Draft Version value for this message template.
- $email : EmailContent|null
- Email value for this message template.
- $hasUnpublishedChanges : bool
- Has Unpublished Changes value for this message template.
- $id : string
- API-generated unique template id.
- $locale : string
- Locale value for this message template.
- $name : string
- Human-readable name.
- $publishedAt : DateTimeImmutable|null
- Time at which the value was published.
- $publishedVersion : int|null
- Published Version value for this message template.
- $purpose : string
- Purpose value for this message template.
- $sms : SMSContent|null
- SMS value for this message template.
- $status : string
- Current lifecycle state.
- $updatedAt : DateTimeImmutable
- Time at which the value was last updated.
- $variables : array<int, Variable>|null
- Variables value for this message template.
- $version : int
- Version value for this message template.
Methods
- __construct() : mixed
- Hydrates a MessageTemplate from decoded Inttegro API data.
- fromArray() : static
- Creates a MessageTemplate from its decoded API wire representation.
- jsonSerialize() : array<string, mixed>
- Returns the same API wire object as `toArray()` for `json_encode()`.
- offsetExists() : bool
- Reports whether a non-null property exists for a PHP or API field name.
- offsetGet() : mixed
- Reads a typed property through PHP `ArrayAccess`.
- offsetSet() : void
- Rejects mutation because domain values are immutable.
- offsetUnset() : void
- Rejects unsetting because domain values are immutable.
- toArray() : array<string, mixed>
- Converts typed properties back to the API's wire representation.
Properties
$about read-only
Additional explanatory text.
public
string|null
$about
Optional response field. PHP type: string|null; wire field: about (string).
$archivedAt read-only
Time at which the value was archived.
public
DateTimeImmutable|null
$archivedAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: archived_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$attachments read-only
Stored file IDs returned by previews. Chime send, schedule, and broadcast currently reject stored-template attachments.
public
GenericValue|null
$attachments
Optional response field. PHP type: \Inttegro\GenericValue|null; wire field: attachments
(array<string>).
$channel read-only
Channel value for this message template.
public
string
$channel
Required response field. PHP type: string; wire field: channel (string).
Compare against Channel cases by using their ->value strings.
$createdAt read-only
Time at which the value was created.
public
DateTimeImmutable
$createdAt
Required response field. PHP type: DateTimeImmutable; wire field: created_at (ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$draftVersion read-only
Draft Version value for this message template.
public
int
$draftVersion
Required response field. PHP type: int; wire field: draft_version (integer).
$email read-only
Email value for this message template.
public
EmailContent|null
$email
Optional response field. PHP type: \Inttegro\MessageTemplate\EmailContent|null; wire field:
email (object).
$hasUnpublishedChanges read-only
Has Unpublished Changes value for this message template.
public
bool
$hasUnpublishedChanges
Required response field. PHP type: bool; wire field: has_unpublished_changes (boolean).
$id read-only
API-generated unique template id.
public
string
$id
Required response field. PHP type: string; wire field: id (string).
$locale read-only
Locale value for this message template.
public
string
$locale
Required response field. PHP type: string; wire field: locale (string).
$name read-only
Human-readable name.
public
string
$name
Required response field. PHP type: string; wire field: name (string).
$publishedAt read-only
Time at which the value was published.
public
DateTimeImmutable|null
$publishedAt
Optional response field. PHP type: DateTimeImmutable|null; wire field: published_at
(ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$publishedVersion read-only
Published Version value for this message template.
public
int|null
$publishedVersion
Optional response field. PHP type: int|null; wire field: published_version (integer).
$purpose read-only
Purpose value for this message template.
public
string
$purpose
Required response field. PHP type: string; wire field: purpose (string).
$sms read-only
SMS value for this message template.
public
SMSContent|null
$sms
Optional response field. PHP type: \Inttegro\MessageTemplate\SMSContent|null; wire field:
sms (object).
$status read-only
Current lifecycle state.
public
string
$status
Required response field. PHP type: string; wire field: status (string).
Compare against Status cases by using their ->value strings.
$updatedAt read-only
Time at which the value was last updated.
public
DateTimeImmutable
$updatedAt
Required response field. PHP type: DateTimeImmutable; wire field: updated_at (ISO-8601 string with UTC offset).
The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.
$variables read-only
Variables value for this message template.
public
array<int, Variable>|null
$variables
Optional response field. PHP type: list<\Inttegro\MessageTemplate\Variable>|null; wire
field: variables (array<object>).
When the field is absent, the SDK exposes an empty collection.
$version read-only
Version value for this message template.
public
int
$version
Required response field. PHP type: int; wire field: version (integer).
Methods
__construct()
Hydrates a MessageTemplate from decoded Inttegro API data.
public
__construct(array<string, mixed> $data) : mixed
Parameters
- $data : array<string, mixed>
-
Wire object keyed by
snake_caseAPI field names.
fromArray()
Creates a MessageTemplate from its decoded API wire representation.
public
static fromArray(array<string, mixed> $data) : static
Parameters
- $data : array<string, mixed>
-
Wire object keyed by
snake_caseAPI field names.
Return values
static —A typed, immutable MessageTemplate value.
jsonSerialize()
Returns the same API wire object as `toArray()` for `json_encode()`.
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>offsetExists()
Reports whether a non-null property exists for a PHP or API field name.
public
offsetExists(mixed $offset) : bool
Both paymentId and payment_id address the same typed property.
Parameters
- $offset : mixed
-
PHP
camelCaseor wiresnake_casefield name.
Return values
booloffsetGet()
Reads a typed property through PHP `ArrayAccess`.
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
PHP
camelCaseor wiresnake_casefield name.
Return values
mixed —The PHP-native property value.
offsetSet()
Rejects mutation because domain values are immutable.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
Ignored field name.
- $value : mixed
-
Ignored replacement value.
Tags
offsetUnset()
Rejects unsetting because domain values are immutable.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
Ignored field name.
Tags
toArray()
Converts typed properties back to the API's wire representation.
public
toArray() : array<string, mixed>
Property names become snake_case. Nested values, arrays, backed enums, and timestamps are
normalized recursively so the result is safe to pass to json_encode().
Return values
array<string, mixed> —The recursively normalized API object.