Need some help customizing a Confluence email template

Hi folks - I'm having a hard time getting the result I want from a customized "editpage-notification.vm" template.

First question: am I editing the Velocity code correctly?

This is the template for HTML emails, not the text-only emails. I want an <h2> heading, followed by 2 <h4> headings announcing the page that changed and the person who changed it. After that, if a version comment exists, I want that comment to display. Lastly, I want the standard set of links that already appear in these emails. Here's the code I'm using:

#parse ("templates/email/html/includes/header.vm")
    &lt;h2&gt;NaviNet Page Change Notification&lt;/h2&gt;
	&lt;h4&gt;Page that changed: &lt;a href="$baseurl$content.urlPath"&gt;$content.title&lt;/a&gt;&lt;/h4&gt;
    &lt;h4&gt;$i18n.getText("email.notification.$contentType") $i18n.getText("") #emailUserLink ($modifier $baseurl)&lt;/h4&gt;
	#if ($content.renderedVersionComment &amp;&amp; $content.renderedVersionComment.length() &gt; 0)
    &lt;div id="versionComment"&gt;
        $content.renderedVersionComment&lt;br /&gt;
    &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
        #parse ("templates/email/html/includes/watch-links.vm")
        &lt;a href="${baseurl}$content.urlPath"&gt;$i18n.getText("")&lt;/a&gt;
        &lt;a href="${baseurl}/pages/diffpagesbyversion.action?pageId=$;revisedVersion=$content.version&amp;originalVersion=$originalContent.version"&gt;$i18n.getText('email.notification.view.changes')&lt;/a&gt;
        #if ($permissionHelper.canComment($remoteUser, $content))
        &lt;a href="${baseurl}$generalUtil.customGetPageUrl($content)showComments=true&amp;amp;showCommentArea=true#addcomment"&gt;$i18n.getText("add.comment")&lt;/a&gt;
#parse ("templates/email/html/includes/footer.vm")

Second question: where exactly should the edited file live?

The documentation here says the file needs to go into a jar file:

But our hosting service says the file should live here on their server:


But when they put the file there and restart Confluence, it has no effect.

Who's right - the Atlassian doc or the hosting service?

1 answer

By the path from your hosting provider, I am guessing that WAR version is being used. Isn't it like, when Confluence is restarted, the WAR is getting re-deployed thus overwriting your changes in the mentioned file? That would mean you have to re-package the WAR file.

Thank you, Radoslaw. According to our hosting provider, they unzip the WAR into the exploded_war directory, and that's what gets read into cache. They put my edited file into the exploded_war directory, so that was/should have been read into cache.

I'm not clear on why, but the custom templates are now working.

Maybe they were leaving the "non-patched" war somewhere around or were not restarting the server.

Anyway great, glad that it is working!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,034 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you