How to change the email notifications to remove content?

Does anyone have insight into editing email notification templates in /confluence/WEB-INF/atlassian-bundled-plugins/confluence-email-notifications-plugin-x.x.jar? I have been following the instructions here https://confluence.atlassian.com/doc/customising-the-email-templates-168001822.html on Confluence 5.5.2, and have searched other forum queries on this topic (one suggesting that “it doesn’t work”).

My goal is to remove the actual content portion of the appropriate SOY file so that when somebody has a watch on a page, they receive a change notification, but the actual content excerpt of the page is not included in the notification. I don’t want users to see what was edited, and I don’t want them to see the excerpt of the original content either. I want to remove that entire “content” box. While I want users to get a notification, for security reasons, I don’t want them to see the content outside the wiki. A user will have to navigate to the wiki page to see the actual content and changes made.

So far I’ve edited the following SOY files, but have not found the desired results:

  • templates/notification/content-added-1.0.0.soy
  • templates/content/content-excerpt-pattern-2.0.0.soy
  • templates/notification/status-updated-1.0.0.soy
  • templates/notification/page-edited-2.0.0.soy
  • templates/notification/page-edit-1.0.0.soy

Much thanks,

Chris

 

2 answers

This widget could not be displayed.

Hello Chris,

did you find solution? If yes, could you share it with us?

Many thanks,

Michal

This widget could not be displayed.

Hi Michal,

In confluence-email-notifications-plugin-6.1.21.jar, the file is located In templates/notification/page-edit-1.0.0.soy. The code in bold was added to put some user-friendly text in the blank spot, otherwise we got an error message appearing. Can’t remember what it was.

Hope this helps.

Disclaimer 1: I am not responsible for problems that may occur if you use my code alterations. Use this code at your own risk.

Disclaimer 2: Please read Atlassian’s red-box warning about editing this JAR file here: https://confluence.atlassian.com/doc/customising-the-email-templates-168001822.html. Ie. They do not support it. Please back up the JAR file before making edits to the SOY file.

Chris

Page-edit-1.0.0.soy

{namespace Confluence.Templates.Mail.Notifications}

/**

* @param avatarCid

* @param modifier

* @param contentType

* @param content

* @param actionLinks

* @param footerLinks

* @param? diffHtml

* @param? showDiffs

*/

{template .pageEdit}

    {natto(['soy-template-file-name' : 'page-edit-1.0.0.soy', 'deprecate-in-version' : '5.5', 'remove-in-version' : '6.0'])}

    {let $pageTitle}

        {call Confluence.Templates.Mail.Content.pageTitlePattern}

            {param contentType: $contentType/}

            {param titleText: $content.title/}

            {param contentUrl}

                {baseUrl()}{$content.urlPath}

            {/param}

        {/call}

    {/let}

    {let $contentExcerpt}

        {if $showDiffs}

            {if $diffHtml}

                {call Confluence.Templates.Mail.Content.contentExcerptPattern}

                    {param contentExcerpt: getText('renderer.site.relative.link.title')/}

                {/call}

            {else}

                {call Confluence.Templates.Mail.Content.contentExcerptPattern}

                    {param contentExcerpt: getText('diff.pages.error.diffing')/}

                {/call}

            {/if}

        {/if}

    {/let}

    {let $pageActions}

        {call Confluence.Templates.Mail.Content.actionsPattern}

            {param actions: $actionLinks/}

        {/call}

    {/let}

   {let $comment}

        {if $content.renderedVersionComment}

            {call Confluence.Templates.Mail.Content.notificationCommentPattern}

                {param comment: getText('confluence.mail.templates.edit.comment', $content.renderedVersionComment)/}

            {/call}

        {/if}

    {/let}

    {call Confluence.Templates.Mail.Chrome.mainTable}

        {param header}

            {call Confluence.Templates.Mail.Chrome.headerPattern}

                {param actionString: getText('confluence.mail.templates.edited.a.page')/}

                {param avatarImage: $avatarCid/}

                {param user: $modifier/}

            {/call}

        {/param}

        {param contentArea: $comment ? [$comment, ['class' : 'padding-top border-top', 'content' : $pageTitle], $contentExcerpt, ['class' : 'action-padding', 'content' : $pageActions]] : [$pageTitle, $contentExcerpt, ['class' : 'action-padding', 'content' : $pageActions]]/}

        {param footer}

            {call Confluence.Templates.Mail.Chrome.footerPattern}

                {param footerLinks: $footerLinks/}

            {/call}

        {/param}

    {/call}

{/template}

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

167 views 1 3
Join discussion

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