Confluence E-Mail Notification Soy Template

Hello,
I tried to edit the soy template “mention-email-notification-2.0.0.soy” in the Confluence web application folder /confluence/WEB-INF/atlassian-bundled-plugins/confluence-mentions-plugin-1.9.23.jar
so that no more content in the notification e-mail is sent.
I followed the steps mentioned here

It would be best if you only received the sentence “you were mentioned in a comment” by e-mail.
Unfortunately, every time I edit the Soy Template, I get the error:
SoyException: Unable to compile Soy templates at: com.atlassian.confluence.plugins.confluence-mentions-plugin:mention-notification-template-body
Anyone know how to edit the template properly?
Thanks

Hi @mgattinger,

Linking the community post here for reference.

Cheers,
Anne

Hi @mgattinger,

So in your last response in the community post, where are you in the steps? I’ve seen a tutorial, they have this:

Confluence uses Soy templates (also known as Closure templates) for email notifications. You can find out more in the Google Developer docs or see our developer tutorial which contains a short introduction to using Soy templates.

Have you tried it?

Thanks!

Cheers,
Anne Calantog

Hi @acalantog,

Thanks.
I am in step 6 “Testing my changes”.
I read both tutorials that you mentioned.

One example what I tried:

  • extracted confluence-email-notifications-plugin-8.8.3.jar
  • edited /templates/content/notification-comment-pattern-1.0.0.soy:

Original:


{namespace Confluence.Templates.Mail.Content}
/**
 * Notification Comment Pattern
 * @param comment
 */
{template .notificationCommentPattern}
<table class="notification-comment-pattern" cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
        <td class="notification-comment-pattern-container mobile-resize-text">
              {$comment|noAutoescape}
        </td>
    </tr>
</table>
{/template}

  • delete @param content and {$comment|noAutoescape}

Customized

{namespace Confluence.Templates.Mail.Content}
/**
 * Notification Comment Pattern
 
 */
{template .notificationCommentPattern}
<table class="notification-comment-pattern" cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
        <td class="notification-comment-pattern-container mobile-resize-text">
             
        </td>
    </tr>
</table>
{/template}

  • dropped the new jar file with changes to /confluence/WEB-INF/atlassian-bundled-plugins folder and restarted the instance
  • Now I created a Test Page
  • Made one user to page-watcher
  • Commented with a second user

Result:

Confluence no longer sends mails.
If I undo the change, the mails are sent again.

I do not know if I edit the correct template, or if I edit the template incorrectly

I would be glad if someone can help me

Regards

Marcel

Hi @mgattinger,

Can you try not removing anything and just try to add few words like “you were mentioned in a comment”? Or does the email sending stop whenever you modify the jar file?

Cheers,
Anne

Hi @acalantog,

I’ve tried your suggestion. It seems that the email sending stop whenever I modify the jar file.

Cheers,
Marcel

Most probably rebuilding the jar file is the problem, e.g. on Mac often the .DS_Store directories are a problem, on Windows this used to be the thumbnail folders. Use the jar cfM tool from Java to rebuild the jar.

1 Like