Managing Email Templates

Jive SBS includes a set of templates to shape the content of emails it sends to people in response to certain events. For each of these, you can edit template content, change template locale, and add new templates for use in other locales.

The templates cover a wide range of actions in the application. Some of these are very common, such as watch notifications sent when content is changed or added (for blogs, documents, spaces, and so on) or when someone requests a reset of their password. Others are sent for actions or events that are more rare. You'll find a complete template list in the admin console. You can also edit the header and footer applied to outbound emails.

Note: You configure other specific aspects of email in other parts of the admin console. For example, you set whether moderation email should be sent at all on the Discussions settings pages.

Editing Email Templates

Email messages sent by the system can be sent as plain text or as HTML. As a result, there are two templates for each kind of message.

When you're editing templates, you use the syntax of FreeMarker, the technology used to render most of the application's user interface. Also, each template supports a specific set of tokens to hold the place of email content that will vary from message to message. For example, the notification email sent to those watching a document includes tokens for the document that's being watched, the person subscribed for notification, and the URL of the document they're watching. In the template text you refer to tokens in the FreeMaker way: ${document}, ${user}, ${docURL}, and so on.

Here are examples designed to tell the receiving person that a document they're watching has been updated. This template begins by telling the recipient who has created or modified the document. It then gives the document title ("subject"). The template also checks to see if the system supports certain other features related to documents, and displays appropriate messages to the recipient:
  • If the system allows commenting on the document simply by replying the notification email.
  • If the system supports updating the document by sending a new version via email.
  • If the system supports creating new content via mail.

Plain Text Template

${contentAuthorName} <#if contentAuthorURL?has_content>[${contentAuthorURL}]</#if> <#if isNewContentItem?? && isNewContentItem>created<#else>modified</#if> the document:

"${contentSubject}"

To view the document, visit: ${contentURL}

<#if includePostContentInEmail && !docVerseDocument && !binaryDocument>
--------------------------------------------------------------
${contentTextBody}
--------------------------------------------------------------
</#if>

<#if emailReplyEnabled>
<#if docVerseDocument && docVerseEnabled>
By replying to this email, you can take action on this document.  If you attach a new version as a file to the email,
a new version of the document will be created.  The body of the reply, if any, will be treated as a comment.
Comment by replying to this email -or- go to the document on ${SkinUtils.getCommunityName()}
[${contentURL}]
<#else>
Comment by replying to this email -or- go to the document on ${SkinUtils.getCommunityName()}
[${contentURL}]
</#if>
<#elseif hasRespondEntitlement>
Comment by going to ${SkinUtils.getCommunityName()}
[${contentURL}]
</#if>

<#if emailCreateEnabled>
Create a new document in ${containerName} by email
[${newContentAddress}] -or- at ${SkinUtils.getCommunityName()}
[${newContentURL}]
<#elseif hasCreateEntitlement>
Create a new document in ${containerName} at ${SkinUtils.getCommunityName()}
[${newContentURL}]
</#if>

HTML Template

<h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    ${contentSubject}
</h3>
<span style="margin-bottom: 10px;">
    <#if isNewContentItem?? && isNewContentItem>created by<#else>modified by</#if> <#if contentAuthorURL?has_content><a href="${contentAuthorURL}">${contentAuthorName}</a><#else>${contentAuthorName}</#if> in <i>${containerName}</i> - <a href="${contentURL}">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<#if includePostContentInEmail && !docVerseDocument && !binaryDocument>
${contentBody}
</#if>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<#if emailReplyEnabled>
<#if docVerseDocument && docVerseEnabled>
    <p style="margin: 0;">By replying to this email, you can take action on this document.  If you attach a new version as a file to the email,
    a new version of the document will be created.  The body of the reply, if any, will be treated as a comment.</p>
<#else>
	<p style="margin: 0;">Comment by replying to this email -or- <a href="${contentURL}">go to the document on ${SkinUtils.getCommunityName()}</a></p>
</#if>
<#elseif hasRespondEntitlement>
    <p style="margin: 0;">Comment by <a href="${contentURL}">going to ${SkinUtils.getCommunityName()}</a></p>
</#if>

<#if emailCreateEnabled>
	<p style="margin: 0;">Create a new document in ${containerName} by <a href="mailto:${newContentAddress}">email</a> -or- at <a href="${newContentURL}">${SkinUtils.getCommunityName()}</a></p>
<#elseif hasCreateEntitlement>
	<p style="margin: 0;">Create a new document in ${containerName} at <a href="${newContentURL}">${SkinUtils.getCommunityName()}</a></p>
</#if>
</div>