Email Provider Plugin

Sending email messages is an extension point of the Curity Identity Server. This makes it possible to manage the email messages’s layout through Curity, as well as taking the data model of the email message and forward it to external systems for further processing.

The default way of sending out email messages is by using the included SMTP Emailer plugin, that takes the model, renders both a text- as well as an HTML-version of the email message using the Velocity template engine, and finally delivers the message in both formats as a multipart/mime message at the configured SMTP server.

If not specified in the model, the email subject is taken from a message key with the format {messagePrefix}.email.subject, where messagePrefix is the message prefix of the template that was used. For example, for a template named authenticator/html-form/email/reset-password/email-template.vm the message key for the email subject is authenticator.html-form.email.reset-password.email.subject key.

SMTP Plugin’s message contents rendering

The template that is used to render emails has its own layout. There are two layouts, one for text- and one for HTML-formatted email messages, which can be found as text-email.vm and html-email.vm in the usr/share/templates/core/layouts directory. If you need to change these, you should do so by creating an override in usr/share/templates/overrides/layout, as explained in the template area override documentation.

The layout will include the template fragments that are specific to the email that is being rendered. For example, the HTML Forms authenticator will send an email when the user requested to reset its password. The body of the HTML and text email messages are defined in the authenticator/html-form/email/reset-password directory through the email.vm and email.txt.vm fragments respectively.