Skip to main content

email_template_customizations

Creates, updates, deletes, gets or lists an email_template_customizations resource.

Overview

Nameemail_template_customizations
TypeResource
Idokta.brands.email_template_customizations

Fields

The following fields are returned by SELECT queries:

Successfully retrieved all email customizations for the specified email template.

NameDatatypeDescription
idstringA unique identifier for this email customization
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
bodystringThe HTML body of the email. May contain variable references. <x-lifecycle class="ea"></x-lifecycle> Not required if Custom languages for Okta Email Templates is enabled. A null body is replaced with a default value from one of the following in priority order: 1. An existing default email customization, if one exists 2. Okta-provided translated content for the specified language, if one exists 3. Okta-provided translated content for the brand locale, if it's set 4. Okta-provided content in English
createdstring (date-time)The UTC time at which this email customization was created.
isDefaultbooleanWhether this is the default customization for the email template. Each customized email template must have exactly one default customization. Defaults to true for the first customization and false thereafter.
languagestringThe language specified as an IETF BCP 47 language tag
lastUpdatedstring (date-time)The UTC time at which this email customization was last updated.
subjectstringThe email subject. May contain variable references. <x-lifecycle class="ea"></x-lifecycle> Not required if Custom languages for Okta Email Templates is enabled. A null subject is replaced with a default value from one of the following in priority order: 1. An existing default email customization, if one exists 2. Okta-provided translated content for the specified language, if one exists 3. Okta-provided translated content for the brand locale, if it's set 4. Okta-provided content in English

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_email_customizationsselectsubdomainafter, limitLists all customizations of an email template

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, all existing customizations are retrieved, including customizations for additional languages. If disabled, only customizations for Okta-supported languages are returned.
get_email_customizationselectsubdomainRetrieves an email customization by its unique identifier

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is disabled, requests to retrieve an additional language customization by ID result in a 404 Not Found error response.
create_email_customizationinsertsubdomain, data__subject, data__bodyCreates a new Email Customization

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, you can create a customization for any BCP47 language in addition to the Okta-supported languages.
replace_email_customizationreplacesubdomain, data__subject, data__bodyReplaces an email customization using property values

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is disabled, requests to update a customization for an additional language return a 404 Not Found error response.
delete_all_customizationsdeletesubdomainDeletes all customizations for an email template

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, all customizations are deleted, including customizations for additional languages. If disabled, only customizations in Okta-supported languages are deleted.
delete_email_customizationdeletesubdomainDeletes an Email Customization by its unique identifier

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is disabled, deletion of an existing additional language customization by ID doesn't register.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)
afterstringThe cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the Link response header. See Pagination.
limitintegerA limit on the number of objects to return

SELECT examples

Lists all customizations of an email template

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, all existing customizations are retrieved, including customizations for additional languages. If disabled, only customizations for Okta-supported languages are returned.

SELECT
id,
_links,
body,
created,
isDefault,
language,
lastUpdated,
subject
FROM okta.brands.email_template_customizations
WHERE subdomain = '{{ subdomain }}' -- required
AND after = '{{ after }}'
AND limit = '{{ limit }}'
;

INSERT examples

Creates a new Email Customization

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, you can create a customization for any BCP47 language in addition to the Okta-supported languages.

INSERT INTO okta.brands.email_template_customizations (
data__body,
data__subject,
data__isDefault,
data__language,
subdomain
)
SELECT
'{{ body }}' /* required */,
'{{ subject }}' /* required */,
{{ isDefault }},
'{{ language }}',
'{{ subdomain }}'
RETURNING
id,
_links,
body,
created,
isDefault,
language,
lastUpdated,
subject
;

REPLACE examples

Replaces an email customization using property values

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is disabled, requests to update a customization for an additional language return a 404 Not Found error response.

REPLACE okta.brands.email_template_customizations
SET
data__body = '{{ body }}',
data__subject = '{{ subject }}',
data__isDefault = {{ isDefault }},
data__language = '{{ language }}'
WHERE
subdomain = '{{ subdomain }}' --required
AND data__subject = '{{ subject }}' --required
AND data__body = '{{ body }}' --required
RETURNING
id,
_links,
body,
created,
isDefault,
language,
lastUpdated,
subject
;

DELETE examples

Deletes all customizations for an email template

<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled, all customizations are deleted, including customizations for additional languages. If disabled, only customizations in Okta-supported languages are deleted.

DELETE FROM okta.brands.email_template_customizations
WHERE subdomain = '{{ subdomain }}' --required
;