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 the email customization.

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
get_email_customizationselectbrandId, templateName, customizationId, subdomainRetrieves 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.
list_email_customizationsselectbrandId, templateName, subdomainafter, 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.
create_email_customizationinsertbrandId, templateName, subdomain, subject, body, languageCreates 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_customizationreplacebrandId, templateName, customizationId, subdomain, subject, body, languageReplaces 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_email_customizationdeletebrandId, templateName, customizationId, subdomainDeletes 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.
delete_all_customizationsdeletebrandId, templateName, subdomainDeletes 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.

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
brandIdstringThe ID of the brand
customizationIdstringThe ID of the email customization
subdomainstring(default: my-org)
templateNamestringThe name of the email template
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 and Link header.
limitintegerA limit on the number of objects to return

SELECT examples​

Retrieves 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.

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

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 (
body,
subject,
isDefault,
language,
brandId,
templateName,
subdomain
)
SELECT
'{{ body }}' /* required */,
'{{ subject }}' /* required */,
{{ isDefault }},
'{{ language }}' /* required */,
'{{ brandId }}',
'{{ templateName }}',
'{{ 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
body = '{{ body }}',
subject = '{{ subject }}',
isDefault = {{ isDefault }},
language = '{{ language }}'
WHERE
brandId = '{{ brandId }}' --required
AND templateName = '{{ templateName }}' --required
AND customizationId = '{{ customizationId }}' --required
AND subdomain = '{{ subdomain }}' --required
AND subject = '{{ subject }}' --required
AND body = '{{ body }}' --required
AND language = '{{ language }}' --required
RETURNING
id,
_links,
body,
created,
isDefault,
language,
lastUpdated,
subject;

DELETE examples​

Deletes 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.

DELETE FROM okta.brands.email_template_customizations
WHERE brandId = '{{ brandId }}' --required
AND templateName = '{{ templateName }}' --required
AND customizationId = '{{ customizationId }}' --required
AND subdomain = '{{ subdomain }}' --required
;