Disable content in notification emails?
Asked by Christian Ohl:

Hello, a basic advantage of confluence is that information can be stored in a central and safe place rather than being sent around in lots of emails.  
However, big portions of information are included in the notification mails.

We would like to keep people informed about changes with email notifications but disable the content. I found those posts related to this issue but I didn't find a solution.

<https://jira.atlassian.com/browse/CONFSERVER-35294>

<https://community.atlassian.com/t5/Questions-for-Confluence/How-to-change-the-email-notifications-to-remove-content/qaq-p/52723>

Is there any solution?

Thanks


Answers:
author: Gregory Van Den Ham
body: You're in the right area. You'll end up just needing to edit the SOY template to remove the content and comments.

<https://confluence.atlassian.com/doc/customizing-email-templates-168001822.html>

None of this is basically supported by Atlassian, and you'll have to put these changes back in place manually after every upgrade you do to confluence.

comments: author: Christian Ohl
body: Thank you for your quick response! Editing SOY templates in jar files is a rather difficult job for me - I will try ...


author: Michael Alexander
body: I will add this is one of the harder parts about upgrades in Confluence. You _can_ modify the templates to not include email content, and so you _have_have to if you want to upgrade. But then the very tedious testing for comments on images, pages, in-line, etc. Meshing style sheets and plugins are at least things you can do on-line.

Where if you miss one template, and the sensitive content is sent to an address a space owner has allowed access to someone, and that someone was setup by Contracting and has his personal email address for his account, now it involves all the people you don't want to involved.

And when you switch from Velocity to Soy to that new thing, oh.. nightmare.

Vote if it helps.

comments: author: Lars V
body: My problem is our instance is in Atlassian cloud rather than local, which, if I understand correctly, means I cannot edit email templates.


author: Michael Alexander
body: I have to do this as well. A checkbox would be much easier. I haven't looked into the details. I think it wouldn't be awful to add the dark configuration that defines a property that is used in the soy if/else condition that removes the content and subsittues with the value of the property (e.g. Sign-on to view content). that might be an enhancement.

Without that, you can do something like the following:

```
jar xvf <basedir>/atlassian-confluence-<version>/confluence/WEB-INF/atlassian-bundled-plugins/confluence-email-notifications-plugin-<version>.jar \
  templates/content/content-excerpt-pattern-1.0.0.soy \
  templates/content/content-excerpt-pattern-2.0.0.soy \
  templates/content/contextual-excerpt-pattern-1.0.0.soy \
  templates/content/contextual-excerpt-pattern-2.0.0.soy
```

Then edit the four files. I think only 2.0.0 are used.

In the content-excerpt-patterns' change $contentExcerpt within the {param} to 'Sign-on to view Content'

In the contextual (AFAIK just comments) change {$inlineContext } to 'Sign-on to view Content'. The context is setup with {call} for the response, that was tricky I couldn't just edit, I had to add a condition.

```
{if 1}
 Sign-on to view content
{else}
 <div>
 {call .inlineContentStyles}
 {param content: $content /}
 {/call}
 </div>
{/if}
```

1 is always true and always prints the Sign-on to view content.

jar uvf and restart.

I went from 5.5.3 to 5.9.14 and this worked. 5.5.3 was way different, I don't think there were as many soy methods/conditions. Just parameters passed in and expanded with the $.

Then update:

jar uvf \<basedir\>/atlassian-confluence-\<version\>/confluence/WEB-INF/atlassian-bundled-plugins/confluence-email-notifications-plugin-\<version\>.jar templates/content/content-excerpt-pattern-1.0.0.soy templates/content/content-excerpt-pattern-2.0.0.soy templates/content/contextual-excerpt-pattern-1.0.0.soy templates/content/contextual-excerpt-pattern-2.0.0.soy

comments: author: Suketa
body: Hey Mickael

I know it's been a long time since your answer.

I have just tried this on Confluence 7.19.16, with plugin on 7.19.4 but it doesn't work, the plugin is not installe when i restart confluence.

Maybe i have a question for contextual file.

Do you agree we have to change $inlineContext in the \<span\> only?

I have tried to modify comment-add-2.0.0 file (notification folder) for example and replace $contentHtml by an empty string but it doesn't work neither.

Perhaps you have found another workaround for next versions ?

Keep me posted if you can


author: Lars V
body: Same problem here - email is insecure, so notifications with content is a no-no if you have to go through something like HIPAA compliance to secure your processes. This is a huge oversight by Atlassian.


author: Axel Heider
body: I've linked a few issue at <https://jira.atlassian.com/browse/CONFSERVER-35294> that are related to this security issue. Maybe that helps and things improve here one day.

Is anybody aware of any plug-ins that address this?