email_templates
Creates, updates, deletes, gets or lists an email_templates resource.
Overview​
| Name | email_templates |
| Type | Resource |
| Id | okta.brands.email_templates |
Fields​
The following fields are returned by SELECT queries:
- get_email_template
- list_email_templates
Successfully retrieved the email template.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of this email template |
_embedded | object | |
_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. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of this email template |
_embedded | object | |
_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. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_email_template | select | brandId, templateName, subdomain | expand | Retrieves the details of an email template by name |
list_email_templates | select | brandId, subdomain | after, limit, expand | Lists all supported email templates |
send_test_email | exec | brandId, templateName, subdomain | language | 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. |
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 |
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. |
expand | array | Specifies additional metadata to be included in the response |
language | string | The language to use for the email. Defaults to the current user's language if unspecified. |
limit | integer | A limit on the number of objects to return |
SELECT examples​
- get_email_template
- list_email_templates
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 }}'
;
Lists all supported email templates
SELECT
name,
_embedded,
_links
FROM okta.brands.email_templates
WHERE brandId = '{{ brandId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND after = '{{ after }}'
AND limit = '{{ limit }}'
AND expand = '{{ expand }}'
;
Lifecycle Methods​
- send_test_email
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 }}'
;