This article describes how to set up an email template in Identity Manager Admin.
In all fields, variables from data pools can be used. To use a variable, navigate to the data pool and variable name in the list to the left, and drag-and-drop it to the intended field. The mail body can be represented in plain text or in HTML format.
Prerequisites
Step-by-step instruction
Log in to Identity Manager Admin
Log in to Identity Manager Admin as an admin
user.
Add or edit email template
To add or edit an email template:
- Go to Home > Emails.
- To add a new email template, click +New. Enter details:
- Enter a Name, for example
EmailNewPassword
, and optionally a Description. - Enter an email address in the To field.
- Click Save+Edit.
- To edit an existing email template, double-click the email template name.
Enter recipients and subject
To enable S/MIME encryption, the following applies:
Do the following:
In the fields CC, and BCC, enter one or more recipients, for example ${BaseDpEmployee_Email}
from the Employee
datapool.
- Enter a Subject.
- Select S/MIME Encryption if the email is to be encrypted.
Select Sign Email if the email is to be signed by the server.
For more information, see Secure email communication using S/MIME in Smart ID.
For email signing: replace the certificate
If you shall use signed emails, you must replace the email signing certificate, emailSignCert
. This is done in the file engineSignEncryptConfig.xml. For more information, see OLD-Sign and encrypt engine in Identity Manager.
- Open the file engineSignEncryptConfig.xml for editing.
Replace the email signing certificate file, emailSigning.p12
, with the correct certificate file.
....
<key name="emailSigningCert">
<type name="pkcs12" locationValue="classpath:emailSigning.p12"
....
For email signing: turn off validation of certificate
By default, the email signing certificate is always validated before sending an email, so that the revocation of the certificate is taken into account as soon as possible. In some cases this is not desired, as it creates some amount of network traffic.
To turn off the certificate validation, do the following:
For WAR file deployment, add this to system.properties:
emailSigner.validateSignatureCertificate=false
For docker deployment, edit the configuration file docker-compose.yml:
- 'SYSTEM_PROPERTIES={
...
"emailSigner.validateSignatureCertificate": false
}'
Enter message as html
The html-formatted message is shown, when the mail server of the recipient supports html.
To enter an email message in HTML format:
- Go to the Html tab.
- Write an html-formatted email message in the text field. To insert a variable, for example
BaseDpEmployee_FirstName
, select the corresponding data pool in the left field and drag-and-drop the variable into the text field.
Enter message as plain text
The plain text message is a fallback solution for when the mail server of the recipient does not support html.
To enter an email message in plain text:
- Go to the Text tab.
- Write an email message in the text field. To insert a variable, for example
BaseDpEmployee_FirstName
, select the corresponding data pool in the left field and drag-and-drop the variable into the text field.
Add attachments
The contents to attach to an email must be in binary form in a data pool. Typical examples of binary data are photos and signatures.
To add an attachment:
- Go to the Attachments tab.
- Navigate to the data pool and field in the list on the left, and drag-and-drop it to the table in the Attachments tab.
- If you want, edit MIME type, to attach the file in a different format.
- If you want, edit the Name of the attachment.
- Click Save.
Edit SMTP settings
To edit the SMTP settings:
- In the Test area field, click on the Expand symbol on the top. On the SMTP Settings tab, the settings are shown.
- To edit the settings, click on the SMTP Settings button.
Enter the SMTP server settings. Click OK to save.
Host: localhost
Port: 25
User:
Password:
Default sender: activiti@localhost
Timeout: 5000
Connection security: NONE
Check server identity: false
- Go to the Preview tab to view all variable expressions.
- If you want, Send test mail to the Test Recipient entered in the SMTP Settings.
Format date fields
You can use four different functions for formatting date fields in an email template.
To format date fields in an email template, do the following:
- In the Test area field, select the Date Formatting tab to view examples and details.
- Enter the date function in the Text or Html tab.
Conversion examples
Sample Field | Defined Value | Expression | Output |
---|
Person_Birthdate | 01.01.1985 | ${Person_BirthDate} | 1985-01-01T00:00:00.000+01:00 |
Type | Description | Sample Function | Sample Output |
---|
Simple Formatted | Simple formatted | ${Date:formatDate(Person_BirthDate,"dd-MM-yyyy")} | 01-01-1985 |
Formatting with Locale | Formatted with German Locale | ${Date:formatDateWithLocale(Person_BirthDate,"dd MMM yyyy","de-DE")} | 01 Jan. 1985 |
Formatting with Locale | Formatted with French Locale | ${Date:formatDateWithLocale(Person_BirthDate,"dd MMM yyyy","fr-FR")} | 01 janv. 1985 |
Formatting with Time Zone | Formatted with time zone of GMT-8 | ${Date:formatDateWithTimezone(Person_BirthDate,"dd-MM-yyyy HH:mm:ss z","GMT-8:00")} | 31-12-1984 15:00:00 GMT-08:00 |
Formatting with Time Zone and Locale | Formatted with time zone of GMT-8 and German Locale | ${Date:formatDateWithTimezoneAndLocale(Person_BirthDate,"dd MMM yyyy HH:mm:ss z","GMT-8:00","de-DE")} | 31 Dez. 1984 15:00:00 GMT-08:00 |
Formatting with Time Zone and Locale | Formatted with time zone of GMT-8 and French Locale | ${Date:formatDateWithTimezoneAndLocale(Person_BirthDate,"dd MMM yyyy HH:mm:ss z","GMT-8:00","fr-FR")} | 31 déc. 1984 15:00:00 GMT-08:00 |