email_template_customizations
Creates, updates, deletes, gets or lists an email_template_customizations resource.
Overview​
| Name | email_template_customizations |
| Type | Resource |
| Id | okta.brands.email_template_customizations |
Fields​
The following fields are returned by SELECT queries:
- get_email_customization
- list_email_customizations
Successfully retrieved the email customization.
| Name | Datatype | Description |
|---|---|---|
id | string | A unique identifier for this email customization |
_links | object | Specifies 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. |
body | string | The 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 |
created | string (date-time) | The UTC time at which this email customization was created. |
isDefault | boolean | Whether 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. |
language | string | The language specified as an IETF BCP 47 language tag |
lastUpdated | string (date-time) | The UTC time at which this email customization was last updated. |
subject | string | The 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 |
| Name | Datatype | Description |
|---|---|---|
id | string | A unique identifier for this email customization |
_links | object | Specifies 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. |
body | string | The 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 |
created | string (date-time) | The UTC time at which this email customization was created. |
isDefault | boolean | Whether 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. |
language | string | The language specified as an IETF BCP 47 language tag |
lastUpdated | string (date-time) | The UTC time at which this email customization was last updated. |
subject | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_email_customization | select | brandId, templateName, customizationId, subdomain | 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. | |
list_email_customizations | select | brandId, templateName, subdomain | after, limit | 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. |
create_email_customization | insert | brandId, templateName, subdomain, subject, body, language | 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. | |
replace_email_customization | replace | brandId, templateName, customizationId, subdomain, subject, body, language | 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. | |
delete_email_customization | delete | brandId, templateName, customizationId, subdomain | 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_all_customizations | delete | brandId, templateName, subdomain | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
brandId | string | The ID of the brand |
customizationId | string | The ID of the email customization |
subdomain | string | (default: my-org) |
templateName | string | The name of the email template |
after | string | The 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. |
limit | integer | A limit on the number of objects to return |
SELECT examples​
- get_email_customization
- list_email_customizations
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
;
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 brandId = '{{ brandId }}' -- required
AND templateName = '{{ templateName }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND after = '{{ after }}'
AND limit = '{{ limit }}'
;
INSERT examples​
- create_email_customization
- Manifest
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
;
# Description fields are for documentation purposes
- name: email_template_customizations
props:
- name: brandId
value: "{{ brandId }}"
description: Required parameter for the email_template_customizations resource.
- name: templateName
value: "{{ templateName }}"
description: Required parameter for the email_template_customizations resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the email_template_customizations resource.
- name: body
value: "{{ body }}"
description: |
The HTML body of the email. May contain [variable references](https://velocity.apache.org/engine/1.7/user-guide.html#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
- name: subject
value: "{{ subject }}"
description: |
The email subject. May contain [variable references](https://velocity.apache.org/engine/1.7/user-guide.html#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
- name: isDefault
value: {{ isDefault }}
description: |
Whether 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.
- name: language
value: "{{ language }}"
description: |
The language specified as an [IETF BCP 47 language tag](https://datatracker.ietf.org/doc/html/rfc5646)
REPLACE examples​
- replace_email_customization
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​
- delete_email_customization
- delete_all_customizations
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
;
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 brandId = '{{ brandId }}' --required
AND templateName = '{{ templateName }}' --required
AND subdomain = '{{ subdomain }}' --required
;