Email templates

OpenIAM has certain out-of-the-box email templates already created. They are used for sending notifications, links with OTPs, request approvals, etc. However, the existing templates can be updated to suit your needs.

Existing Email Templates Review

To access the existing email templates, log into the web console and go to Administration > Mail Template Editor.

The Mail Template Name dropdown contains all the existing templates that can be chosen and configured. The NEW_HIRE_WITH_APPROVAL_NOTIFY template will be used as an example further in the document.

Find the required email template in the dropdown. Below the name, you will see several other fields related to the template chosen.

Example template

FieldDescription
Is enabled?Checkbox indicating whether the mail template is used for the set purpose. It means that whenever the particular process (new hire in this case) is triggered via the code or in any other way, the email will be sent to an approver.
Is HTML?If checked, the email content will be interpreted and rendered as HTML. This checkbox is usually used when the look of the email needs to be changed, e.g., a specific font needs to be used, bold or italic font needs to be used, particular text has to be highlighted, etc. Note that if you check the HTML checkbox, the attributes returned from the email body (firstName, password, etc.) have to follow the OpenIAM standards; otherwise, the attributes will not be passed.
Metadata TypeStands for the metadata used for this particular template.
Mail Template DescriptionA short description of what this template is used for.
Mail Template SubjectThe subject line of an email. This value can be updated to suit your needs or requirements.
Mail Template ContentThe email body with particular parameters.
Mail Template PropertiesMeans a list of properties that are available for filling up template with details. It is a dynamic data that will actually be shown when email is build and sent.

Customizing Email Templates

In case the out-of-the-box default templates do not work for a particular purpose, there is a possibility of creating a custom email template. We still recommend using the default templates and amending them to suit the business purpose.

However, if there is a need for another template that the default list doesn't include, it can be added to the database. The inclusion query looks as follows:

INSERT INTO MAIL_TEMPLATE (ID, TEMPLATE_NAME, CAPTION, CONTENT, DESCRIPTION, IS_HTML)
VALUES ('MAILBOX_CREATD_MAIL_UPDT_TO_MGR','MAILBOX_CREATD_MAIL_UPDT_TO_MGR','Mailbox account created',' text' , 'Mailbox account created','Y');

MAILBOX_CREATED_MAIL_UPDATE_TO_MGR and MAILBOX_CREATED_MAIL_UPDATE_TO_MGR are the name and ID of the template that will appear in the Mail Template Name dropdown. Here, they were kept the same to make it easy to query in the database.

The new template will be shown in the dropdown, and you will be able to enable it to be called further after the OpenIAM will synchronize with the database.