<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
How to Customize Email Templates for Management API Calls
Okta Identity Engine
API Access Management
Overview

Certain Management API Calls, such as password resets, will result in an Email being delivered to users. This article clarifies whether there is a way to customize these emails depending on the use case.

Applies To
  • Email Templates
  • Okta Identity Engine (OIE)
  • OAuth for Okta Management API Calls
Cause

Unique email customizations based on the API token being used cannot be made for management API calls that use an Okta API Token. 

If the API call is made with an OAuth Access Token, the Email template can render differently based on the Client ID of the OAuth Application which the Access Token was retrieved from. 

Solution

The Okta OIE Expression Language introduced 3 new variables that can be used in Email Templates:

  • ${app.id}
  • ${app.name}
  • ${app.label}

These variables are available to email templates when the Email is generated by a user accessing an application.

They are also available to the Management API calls if the API Call is done with an OAuth Access Token.

 

Modifying the User Activation Email Template with the below:

 

...
...
                        Your organization's sign-in page is <a href="${baseURL}" style="color: #007dc1; text-decoration: none;"><span style="color: #007dc1; text-decoration: none;">${baseURL}</span></a>
                    </td>
                </tr>
                #if(${app.id})
                    <tr>
                        <td style="padding-top: 24px;">
                            Registered via App ${app.name}
                        </td>
                    </tr>
                #else
                    <tr>
                        <td style="padding-top: 24px;">
                            Registered with an API Token
                        </td>
                    </tr>
                #end
                <tr>
                    <td style="padding-top: 24px;">
                        If you experience difficulties accessing your account, 
...
...

 

  • This will result in an Email with the App Name if an Access Token is used to activate the user:

 

  • If an API Token is used to activate the user, the Email will be rendered without the App Name:

Loading
How to Customize Email Templates for Management API Calls