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")
<h2>NaviNet Page Change Notification</h2>
<h4>Page that changed: <a href="$baseurl$content.urlPath">$content.title</a></h4>
<h4>$i18n.getText("email.notification.$contentType") $i18n.getText("email.html.edited.by") #emailUserLink ($modifier $baseurl)</h4>
#if ($content.renderedVersionComment && $content.renderedVersionComment.length() > 0)
<br/>
<div id="versionComment">
<h4>$action.getText('comment.name'):</h4>
$content.renderedVersionComment<br />
</div>
#end
<br/>
<div id="commentsSection" class="wiki-content pageSection">
#parse ("templates/email/html/includes/watch-links.vm")
<a href="${baseurl}$content.urlPath">$i18n.getText("email.notification.view.online")</a>
|
<a href="${baseurl}/pages/diffpagesbyversion.action?pageId=$content.id&revisedVersion=$content.version&originalVersion=$originalContent.version">$i18n.getText('email.notification.view.changes')</a>
#if ($permissionHelper.canComment($remoteUser, $content))
|
<a href="${baseurl}$generalUtil.customGetPageUrl($content)showComments=true&amp;showCommentArea=true#addcomment">$i18n.getText("add.comment")</a>
#end
</div>
#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: https://confluence.atlassian.com/display/DOC/Customising+the+eMail+Templates
But our hosting service says the file should live here on their server:
/opt/j2ee/domains/navinet.net/partner/webapps/atlassian-confluence/deployments/current/exploded_war/WEB-INF/classes/templates/email/email/editpage-notification.vm
But when they put the file there and restart Confluence, it has no effect.
Who's right - the Atlassian doc or the hosting service?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe they were leaving the "non-patched" war somewhere around or were not restarting the server.
Anyway great, glad that it is working!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.