Difference between revisions of "Notification and subscription messages"
m |
m |
||
Line 1: | Line 1: | ||
− | When you are subscribed to a document, any change in the document will be notified by email. These email messages are created using some defined templates. You can modify these default templates to create messages adapted to your company style. This modification is done editing the file OpenKM.cfg. | + | When you are subscribed to a document, any change in the document will be notified by email. These email messages are created using some defined templates. You can modify these default templates to create messages adapted to your company style. This modification is done editing the file [[OpenKM.cfg]]. |
{{Advice|'''In OpenKM 5.1 Velocity will be replaced by FreeMarker.'''}} | {{Advice|'''In OpenKM 5.1 Velocity will be replaced by FreeMarker.'''}} |
Revision as of 10:22, 14 February 2011
When you are subscribed to a document, any change in the document will be notified by email. These email messages are created using some defined templates. You can modify these default templates to create messages adapted to your company style. This modification is done editing the file OpenKM.cfg.
In OpenKM 5.1 Velocity will be replaced by FreeMarker. |
These are the default values:
notification.message.subject | OpenKM - NOTIFICATION - ${documentName} |
---|---|
notification.message.body | <b>Document: </b><a href=\"${documentUrl}\">${documentPath}</a><br/><b>User: </b>${userId}<br/><b>Message: </b>${notificationMessage}<br/> |
subscription.message.subject | OpenKM - ${eventType} - ${documentPath} |
subscription.message.body | <b>Document: </b><a href=\"${documentUrl}\">${documentPath}</a><br/><b>User: </b>${userId}<br/><b>Event: </b>${eventType}<br/><b>Comment: </b>${subscriptionComment}<br/> |
subscription.twitter.status | OpenKM - ${documentUrl} - ${documentPath} - ${userId} - ${eventType} |
And these are the substitution variables used:
Notification message subject & body
- ${documentUrl} - Document URL
- ${documentPath} - Document path
- ${documentName} - Document name
- ${userId} - User id
- ${notificationMessage} - Notification message
Subscription message subject & body & twitter
- ${documentUrl} - Document URL
- ${documentPath} - Document path
- ${documentName} - Document name
- ${userId} - User id
- ${eventType} - Event type
- ${subscriptionComment} - Subscription comment
More info on this can be found at:
- http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
- http://www.w3schools.com/tags/ref_entities.asp
If you want to elaborate a more complex template, the limitations of Java Properties are a disadvantage. In this case you can set the subscription.message.subject property to a template filename (for example, ComplexSubcriptionSubject.ftl). The template file should have the .ftl extension and needs to be locate at $JBOSS_HOME directory.
More info about FreeMarker templates at FreeMarker User Guide.
OpenKM 5.0.x
These are the default values:
notification.message.subject | OpenKM - NOTIFICATION - $documentName |
---|---|
notification.message.body | <b>Document: </b><a href=\"$documentUrl\">$documentPath</a><br/><b>User: </b>$userId<br/><b>Message: </b>$notificationMessage<br/> |
subscription.message.subject | OpenKM - $eventType - $documentPath |
subscription.message.body | <b>Document: </b><a href=\"$documentUrl\">$documentPath</a><br/><b>User: </b>$userId<br/><b>Event: </b>$eventType<br/><b>Comment: </b>$subscriptionComment<br/> |
subscription.twitter.status | OpenKM - $documentUrl - $documentPath - $userId - $eventType |
And these are the substitution variables used:
Notification message subject & body
- $documentUrl - Document URL
- $documentPath - Document path
- $documentName - Document name
- $userId - User id
- $notificationMessage - Notification message
Subscription message subject & body & twitter
- $documentUrl - Document URL
- $documentPath - Document path
- $documentName - Document name
- $userId - User id
- $eventType - Event type
- $subscriptionComment - Subscription comment
More info on this can be found at:
- http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
- http://www.w3schools.com/tags/ref_entities.asp
If you want to elaborate a more complex template, the limitations of Java Properties are a disadvantage. In this case you can set the subscription.message.subject property to a template filename (for example, ComplexSubcriptionSubject.vm). The template file should have the .vm extension and needs to be locate at $JBOSS_HOME directory.
More info about Velocity templates at Apache Velocity User Guide.
OpenKM 4.0 and older
These are the default values:
notify.message.subject | OpenKM - NOTIFICATION - {0} |
---|---|
notify.message.body | <b>Document: </b><a href="{0}">{1}</a><br/><b>User: </b>{3}<br/><b>Message:</b>{4}<br/> |
subscription.message.subject | OpenKM - {0} - {1} |
subscription.message.body | <b>Document: </b><a href="{0}">{1}</a><br/><b>User: </b>{3}<br/><b>Event:</b>{4}<br/><b>Comment: </b>{5}<br/> |
And these are the substitution variables used:
NOTIFY MESSAGE SUBJECT | NOTIFY MESSAGE BODY |
---|---|
{0} - document path | {0} - document URL |
{1} - document name | {1} - document path |
{2} - document name | |
{3} - user id | |
{4} - message |
SUBSCRIPTION MESSAGE SUBJECT | SUBSCRIPTION MESSAGE BODY |
---|---|
{0} - event type | {0} - document URL |
{1} - document path | {1} - document path |
{2} - document name | {2} - document name |
{3} - user id | |
{4} - event type |