Skip to main content

email_templates

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

Overview​

Nameemail_templates
TypeResource
Idokta.brands.email_templates

Fields​

The following fields are returned by SELECT queries:

Successfully retrieved the email template.

NameDatatypeDescription
namestringThe name of this email template
_embeddedobject
_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.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_email_templateselectbrandId, templateName, subdomainexpandRetrieves the details of an email template by name
list_email_templatesselectbrandId, subdomainafter, limit, expandLists all supported email templates
send_test_emailexecbrandId, templateName, subdomainlanguageSends a test email to the current user's primary and secondary email addresses. The email content is selected based on the following priority:
1. The email customization for the language specified in the language query parameter
<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled and the language parameter is an additional language, the test email uses the customization corresponding to the language.
2. The email template's default customization
3. The email template's default content, translated to the current user's language

You can only send customized test emails if you've configured a custom email domain. If you don't have a custom email domain, test emails use the Okta default template and are sent from the Okta email domain.

> Note: Super admins can view customized email templates with the Send a test email request. However, when custom email templates are sent to super admins as part of actual email notification flows, the customizations aren't applied. Instead, the default email template is used. This only applies to super admins.

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
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.
expandarraySpecifies additional metadata to be included in the response
languagestringThe language to use for the email. Defaults to the current user's language if unspecified.
limitintegerA limit on the number of objects to return

SELECT examples​

Retrieves the details of an email template by name

SELECT
name,
_embedded,
_links
FROM okta.brands.email_templates
WHERE brandId = '{{ brandId }}' -- required
AND templateName = '{{ templateName }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND expand = '{{ expand }}'
;

Lifecycle Methods​

Sends a test email to the current user's primary and secondary email addresses. The email content is selected based on the following priority:
1. The email customization for the language specified in the language query parameter
<x-lifecycle class="ea"></x-lifecycle> If Custom languages for Okta Email Templates is enabled and the language parameter is an additional language, the test email uses the customization corresponding to the language.
2. The email template's default customization
3. The email template's default content, translated to the current user's language

You can only send customized test emails if you've configured a custom email domain. If you don't have a custom email domain, test emails use the Okta default template and are sent from the Okta email domain.

> Note: Super admins can view customized email templates with the Send a test email request. However, when custom email templates are sent to super admins as part of actual email notification flows, the customizations aren't applied. Instead, the default email template is used. This only applies to super admins.

EXEC okta.brands.email_templates.send_test_email
@brandId='{{ brandId }}' --required,
@templateName='{{ templateName }}' --required,
@subdomain='{{ subdomain }}' --required,
@language='{{ language }}'
;