The content below is for Apache Syncope <= 1.2 - for later versions the Reference Guide is available. |
You can create new (and modify existing) template messages to customize the body of notification messages. This can be achieved by creating and / or modifying the notification e-mail template files.
Templates are defined by their name.
Each template is made up of a couple of files:
.html.vm).txt.vm)For example, the default optin template is defined by:
optin.html.vmoptin.txt.vmAssuming you have generated and built your own project, existing templates (including the default optin template) are located under
core/target/syncope/WEB-INF/classes/mailTemplates/ |
You need to create your own template files (or copy existing to modify) under
core/src/main/resources/mailTemplates/ |
Template files are interpreted using the Velocity engine; check the language reference.
Besides standard expressions, you can use the following Syncope-specific variables:
usersyncopeConfMap<String, String> containing all defined configurations as <key, value> - see how to manage these itemsrecipientseventsString containing all the events that could have triggered the current notificationNew Syncope-specific variable were added:
typecategoryString) of event being notifiedsubcategory
subcategory (String) of event being notifiedeventString) that actually triggered the current notificationĀ conditionNotifications can be related to RESTful method invocation that actually changed an entity (user, role, resource, ...). In this case, additional variables are available:
beforeObject) before actual modification took placeĀ inputObject[])Object) returned by RESTful method$user.getUsername() |
$user.getAttributeMap().get("email").getValues().get(0) |
#foreach($membership in $user.getMemberships())
$membership.roleId
$membership.roleName
$membership.getAttributeMap().get("membershipAttr").getValues().get(0)
#end |