JavaScript SDK email overview

šŸ“˜

Much of the content on this page deals with a legacy feature of the Akamai Identity Cloud (in this case, the JavaScript SDK). If you are currently an Identity Cloud customer and are using the JavaScript SDK, that SDK is still supported. However, if youā€™re new to the ā€‹Akamaiā€‹ the JavaScript SDK is no longer available. Instead, you should use Hosted Login for your login and registration needs.


The Standard Registration Experience provides transactional emails for common events such as registration confirmation, email verification, and password reset. By default, ā€‹Akamaiā€‹ sends emails for you by using Amazon Simple Email Services (Amazon SES). However, customers can choose to send transactional emails using their own email service or provider. Email preference is configured by using the email_method API Client setting. If email_method is set to ses_sync (the default value) then transactional emails are sent by ā€‹Akamaiā€‹ and Amazon SES. To send emails using a different service or provider, contact your Akamai representative.

The content for existing emails can be modified by using theĀ Configuration API. In addition, ā€‹Akamaiā€‹ can add new emails (to be sent in response to additional registration events) to your flow. Additional information on transactional emails can be found in theĀ Customize transactional emails topic.


šŸ“˜

When modifying emails, keep in mind that no single line in that email can exceed 998 characters. (Technically, the limit is 1,000 characters, but you must allow for a two-character carriage return-linefeed at the end of each line.) Can you have an email that has 5 lines, each containing 997 characters? Yes. Can you have an email that has 1 lines containing 1,001 characters? No.


The following sections describe theĀ default emails and when they are triggered.


Email template variables

ā€‹Akamaiā€‹'s Identity Cloud Registration can perform string substitutions in email templates for variables such as the userā€™s name or the site name where the user registered for personalization and site-specific customization. This allows you to use the same email templates for different websites or applications that share the same Registration configuration. Variables may be pulled from either the userā€™s record or API client settings found on the Manage Properties page in the Console).

The example email below shows how this will look:

<p>Welcome to {*#settings*}{*site\_name*}{*/settings*}, {*#user*}{*givenName*}{*/user*}!</p>
<p>To complete your new registration, just click on or browse to the URL below to verify this email address.</p>
<p><a href=""></a></p>

User data variables are included by specifying the entity type in a JTL tag wrapper around the schema attribute name. For example,Ā {*#user*}{*givenName*}{*/user*}Ā pulls in data stored in the givenName schema attribute. Any schema attribute may be referenced in this way.

Setting variables are included by specifying the setting name inside of a JTL tag wrapper for settings. For example,Ā {*#settings*}{*site_name}{*/settings}Ā  pulls in the content defined in theĀ site_nameĀ API client setting. Any setting may be referenced in this way.

Email templates may also include special JTL link tags that reference API client settings without theĀ {#settings}{/settings}Ā wrapper. These JTL tags may not be modified.

  • {*password_recover_url*}. Generates a unique link for theĀ passwordRecoverĀ email by appending an authorization code to the URL defined in theĀ password_recover_urlĀ client setting. This code has a configurableĀ duration and is valid for 1 day by default.

  • {*email_verification_url*}.- Generates a unique link for theĀ registrationVerificationĀ andĀ emailAddressChangedĀ emails by appending a verification code to the URL defined in theĀ verify_email_urlĀ client setting. This code also has a configurableĀ duration and is valid for 1 day by default.


Email template formatting

Transactional emails are always sent in a combinedĀ .htmlĀ andĀ .txtĀ format. Both versions must be supplied for each email and should follow these formatting guidelines:

  • Images. Images must be hosted on your servers and included in the HTML as absolute paths. If you need to include different images per site, variables pulled from the API client settings may reference image URL paths. SeeĀ Email Template Variables above for more information on how to include variables in email templates.

  • CSS Styling. HTML emails should include inline CSS for styling so that the content can be properly displayed in email client applications. We recommend researching how best to prepare single-file HTML content for email transfers as the structure will be slightly different than a traditional HTML web page.

  • Encoding HTML Entities.Ā Registration encodes HTML entities in the URLs by default, which is the desired behavior in an HTML email but not in a text email. Variables used in the text versions of the emails must include an ampersand (ā€&ā€œ) character before the setting or schema attribute name to suppress the encoding. The example below shows how you would format the same email given in the example above as a text version.

Welcome to {*#settings*}{*&site\_name*}{*/settings*}, {*#user*}{*&givenName*}{*/user*}!
  To complete your new registration, just click on or browse to the URL below to verify this email address.
  {*&email\_verification\_url*}