EmailTemplates
extends ManagementEndpoint
in package
implements
EmailTemplatesInterface
Class EmailTemplates.
Handles requests to the Email Templates endpoint of the v2 Management API.
Tags
Interfaces, Classes, Traits and Enums
- EmailTemplatesInterface
- Interface EmailTemplatesInterface.
Table of Contents
- $httpClient : HttpClient
- __construct() : mixed
- ManagementEndpoint constructor.
- create() : ResponseInterface
- Create an email template by name.
- get() : ResponseInterface
- Get an email template by name.
- getHttpClient() : HttpClient
- Get the injected HttpClient instance.
- getLastRequest() : HttpRequest|null
- Return an instance of HttpRequest representing the last issued request.
- getResponsePaginator() : HttpResponsePaginator
- Return a ResponsePaginator instance configured for the last HttpRequest.
- instance() : static
- patch() : ResponseInterface
- Patch an email template by name.
- update() : ResponseInterface
- Update an email template by name.
Properties
$httpClient
private
HttpClient
$httpClient
Methods
__construct()
ManagementEndpoint constructor.
public
final __construct(HttpClient $httpClient) : mixed
Parameters
- $httpClient : HttpClient
-
httpClient instance to use
Return values
mixed —create()
Create an email template by name.
public
create(string $template, string $body, string $from, string $subject, string $syntax, bool $enabled[, array<string|int, mixed>|null $additional = null ][, RequestOptions|null $options = null ]) : ResponseInterface
See docs @see below for valid names and fields.
Required scope: create:email_templates
.
Parameters
- $template : string
-
The template name. See the @see for a list of templates available.
- $body : string
-
body of the email template
- $from : string
-
senders from email address
- $subject : string
-
subject line of the email
- $syntax : string
-
syntax of the template body
- $enabled : bool
-
whether the template is enabled (true) or disabled (false)
- $additional : array<string|int, mixed>|null = null
-
Additional body content to pass with the API request. See @see for supported options.
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —get()
Get an email template by name.
public
get(string $templateName[, RequestOptions|null $options = null ]) : ResponseInterface
See docs @see below for valid names and fields.
Required scope: read:email_templates
.
Parameters
- $templateName : string
-
The email template name. See the @see for a list of templates available.
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —getHttpClient()
Get the injected HttpClient instance.
public
final getHttpClient() : HttpClient
Return values
HttpClient —getLastRequest()
Return an instance of HttpRequest representing the last issued request.
public
final getLastRequest() : HttpRequest|null
Return values
HttpRequest|null —getResponsePaginator()
Return a ResponsePaginator instance configured for the last HttpRequest.
public
final getResponsePaginator() : HttpResponsePaginator
Return values
HttpResponsePaginator —instance()
public
static instance(HttpClient $httpClient) : static
Parameters
- $httpClient : HttpClient
Return values
static —patch()
Patch an email template by name.
public
patch(string $templateName, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface
This will update only the email template data fields provided (see HTTP PATCH).
See docs @see below for valid names, fields, and possible responses.
Required scope: update:email_templates
.
Parameters
- $templateName : string
-
The email template name. See the @see for a list of templates available.
- $body : array<string|int, mixed>
-
update existing template fields with this data
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —update()
Update an email template by name.
public
update(string $templateName, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface
This will replace the email template data.
See docs @see below for valid names, fields, and possible responses.
Required scope: update:email_templates
.
Parameters
- $templateName : string
-
The email template name. See the @see for a list of templates available.
- $body : array<string|int, mixed>
-
replace existing template with this data
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)