Difference between revisions of "Notification and subscription messages"

From OpenKM Documentation
Jump to: navigation, search
 
(23 intermediate revisions by 3 users not shown)
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 to you 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 by editing the [[Configuration view]].
  
{{Note|Be careful to set the property application.url or this OpenKM feature won't work.}}
+
{{Advice|'''In OpenKM 5.1 Velocity was replaced by FreeMarker.'''}}
  
 
These are the default values:
 
These are the default values:
  
{| border="1"
+
'''OpenKM 6.2 Professional'''
 +
 
 +
{| border="1" cellpadding="5" cellspacing="0"
 +
! align="left"| notification.message.subject
 +
| <nowiki>OpenKM - NOTIFICATION</nowiki>
 +
|-
 +
! align="left"| notification.message.body
 +
| <nowiki><b>Message: </b>${notificationMessage}<br/>
 +
<b>User: </b>${userId}<br/>
 +
<#list documentList as doc>
 +
<b>Document: </b><a href="${doc.url}">${doc.path}</a><br/>
 +
</#list></nowiki>
 +
|-
 +
! align="left"| subscription.message.subject
 +
| <nowiki>OpenKM - ${eventType} - ${documentPath}</nowiki>
 +
|-
 +
!align="left"| subscription.message.body
 +
| <nowiki><b>Document: </b><a href="${documentUrl}">${documentPath}</a><br/>
 +
<b>User: </b>${userId}<br/><b>Event: </b>${eventType}<br/>
 +
<b>Comment: </b>${subscriptionComment}<br/></nowiki>
 +
|-
 +
!align="left"| subscription.twitter.status
 +
| <nowiki>OpenKM - ${documentUrl} - ${documentPath} - ${userId} - ${eventType}</nowiki>
 +
|}
 +
 
 +
'''OpenKM 6.2 Community'''
 +
 
 +
{|  border="1" cellpadding="5" cellspacing="0"
 +
! align="left"| notification.message.subject
 +
| <nowiki>OpenKM - NOTIFICATION - ${documentName}</nowiki>
 +
|-
 +
! align="left"| notification.message.body
 +
| <nowiki><b>Document: </b><a href="${documentUrl}">${documentPath}</a><br/><b>User: </b>${userId}<br/><b>Message: </b>${notificationMessage}<br/></nowiki>
 +
|-
 +
! align="left"| subscription.message.subject
 +
| <nowiki>OpenKM - ${eventType} - ${documentPath}</nowiki>
 +
|-
 +
!align="left"| subscription.message.body
 +
| <nowiki><b>Document: </b><a href="${documentUrl}">${documentPath}</a><br/><b>User: </b>${userId}<br/><b>Event: </b>${eventType}<br/><b>Comment: </b>${subscriptionComment}<br/></nowiki>
 +
|-
 +
!align="left"| subscription.twitter.status
 +
| <nowiki>OpenKM - ${documentUrl} - ${documentPath} - ${userId} - ${eventType}</nowiki>
 +
|}
 +
 
 +
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 use a more complex template, the limitations of Java Properties files are a problem. 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 located in the ''$JBOSS_HOME'' directory.
 +
 
 +
{{Note|FreeMarker does not allow you to render null values (will throw an exception). If you expect a value to be null you can also use the ! operator: ${content.title!}. This is the equivalent to ${content.title!''}.}}
 +
 
 +
More info about FreeMarker templates at [http://freemarker.sourceforge.net/docs FreeMarker User Guide].
 +
 
 +
== OpenKM 5.0.x ==
 +
These are the default values:
 +
 
 +
{|  border="1" cellpadding="5" cellspacing="0"
 +
! align="left"| notification.message.subject
 +
| <nowiki>OpenKM - NOTIFICATION - $documentName</nowiki>
 +
|-
 +
! align="left"| notification.message.body
 +
| <nowiki><b>Document: </b><a href="$documentUrl">$documentPath</a><br/><b>User: </b>$userId<br/><b>Message: </b>$notificationMessage<br/></nowiki>
 +
|-
 +
! align="left"| subscription.message.subject
 +
| <nowiki>OpenKM - $eventType - $documentPath</nowiki>
 +
|-
 +
!align="left"| subscription.message.body
 +
| <nowiki><b>Document: </b><a href="$documentUrl">$documentPath</a><br/><b>User: </b>$userId<br/><b>Event: </b>$eventType<br/><b>Comment: </b>$subscriptionComment<br/></nowiki>
 +
|-
 +
!align="left"| subscription.twitter.status
 +
| <nowiki>OpenKM - $documentUrl - $documentPath - $userId - $eventType</nowiki>
 +
|}
 +
 
 +
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
 +
 
 +
{{Warning|Take note of the [[OpenKM.cfg]] format: this is a Java properties file and has some limitations, for example, this file has to be coded in ISO-8859-1 format. Also single quotes (<nowiki>'</nowiki>) should be escaped with another single quote (<nowiki>''</nowiki>).}}
 +
 
 +
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 use a more complex template, the limitations of Java Properties files are a problem. 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 located in the ''$JBOSS_HOME'' directory.
 +
 
 +
More info about Velocity templates at [http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html Apache Velocity User Guide].
 +
 
 +
== OpenKM 4.0 and older  ==
 +
These are the default values:
 +
 
 +
{| align="center" border="1" cellpadding="5" cellspacing="0"
 
! align="left"| notify.message.subject
 
! align="left"| notify.message.subject
| OpenKM - NOTIFICATION - {0}
+
| <nowiki>OpenKM - NOTIFICATION - {0}</nowiki>
 
|-
 
|-
 
! align="left"| notify.message.body  
 
! align="left"| notify.message.body  
Line 13: Line 134:
 
|-
 
|-
 
! align="left"| subscription.message.subject  
 
! align="left"| subscription.message.subject  
| OpenKM - {0} - {1}
+
| <nowiki>OpenKM - {0} - {1}</nowiki>
 
|-
 
|-
 
!align="left"| subscription.message.body  
 
!align="left"| subscription.message.body  
Line 21: Line 142:
 
And these are the substitution variables used:
 
And these are the substitution variables used:
  
{| style="width: 600px"
+
{| align="center" border="0" cellpadding="5" cellspacing="0" style="width: 600px"
 
! align="left"| NOTIFY MESSAGE SUBJECT !! align="left"| NOTIFY MESSAGE BODY
 
! align="left"| NOTIFY MESSAGE SUBJECT !! align="left"| NOTIFY MESSAGE BODY
 
|-
 
|-
Line 35: Line 156:
 
|}
 
|}
  
{| style="width: 600px"
+
 
 +
{| align="center" border="0" cellpadding="5" cellspacing="0" style="width: 600px"
 
! align="left"| SUBSCRIPTION MESSAGE SUBJECT !! align="left"| SUBSCRIPTION MESSAGE BODY
 
! align="left"| SUBSCRIPTION MESSAGE SUBJECT !! align="left"| SUBSCRIPTION MESSAGE BODY
 
|-
 
|-
Line 48: Line 170:
 
|                    || {4} - event type
 
|                    || {4} - event type
 
|}
 
|}
 
{{Warning|Take care of the OpenKM.cfg format: this is a Java properties file and has some limitations, for example, this file have to be coded in ISO-8859-1 format. Also single quotes (<nowiki>'</nowiki>) should be protected with another single quote (<nowiki>''</nowiki>).}}
 
 
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
 
  
 
[[Category: Installation Guide]]
 
[[Category: Installation Guide]]

Latest revision as of 17:01, 6 May 2013

When you are subscribed to a document, any change in the document will be notified to you 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 by editing the Configuration view.


Nota idea.png In OpenKM 5.1 Velocity was replaced by FreeMarker.

These are the default values:

OpenKM 6.2 Professional

notification.message.subject OpenKM - NOTIFICATION
notification.message.body <b>Message: </b>${notificationMessage}<br/> <b>User: </b>${userId}<br/> <#list documentList as doc> <b>Document: </b><a href="${doc.url}">${doc.path}</a><br/> </#list>
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}

OpenKM 6.2 Community

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:

If you want to use a more complex template, the limitations of Java Properties files are a problem. 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 located in the $JBOSS_HOME directory.


Nota clasica.png FreeMarker does not allow you to render null values (will throw an exception). If you expect a value to be null you can also use the ! operator: ${content.title!}. This is the equivalent to ${content.title!}.

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

Nota advertencia.png Take note of the OpenKM.cfg format: this is a Java properties file and has some limitations, for example, this file has to be coded in ISO-8859-1 format. Also single quotes (') should be escaped with another single quote ('').

More info on this can be found at:

If you want to use a more complex template, the limitations of Java Properties files are a problem. 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 located in the $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