Email notification plugin customization

I can see the java class in the confluence email notification plugin that generates the notification email. I can also add header information to the email.

Is there some mechanism to determine the page that generated the notification at that point? I thought there might be something in the Message metadata Map but it is empty. Any hints on where the notification is initially generated? I could possibly just use the metadata to pass along what I need.

Update 31 January
I see emails getting generated from ConfluenceSystemMailServer.send()
I thought I could get the contentId form what is returned from message.getMessageId() but it returns null.
I do see some “TODO we should fix this” comments which is not comforting.
We are stuck with Confluence 6.2.0 as we heavily modify it but is there a newer version of confluence_emial_notifications than 8.8.3 that is more complete?
Is there some other place where we could sneak the contentIDd into the metadata Map?

Hi William,

Thanks for your question. The email is rendered using a soy template in ConfluenceNotificationRenderer#render from the confluence-notifications plugin. One of the parameters of this method is the render context, which is a map that contains content id under the key ‘contentId’. You can use the maven dependency below to see the code:

com.atlassian.confluence.plugins confluence-notifications-spi-plugin 8.10.0