When somebody creates a blog post in one of our Confluence pages, we want to e-mail the content to a distribution list. I have successfully created an event listener using ScriptRunner to call a mail-dispatch API and send the raw page content, which renders all right as HTML in an e-mail client. However, any macros in the content are in raw wiki code form and are not rendered. How can I use the Confluence Java API to render the page content to (X)HTML and send that to my e-mail service?
I am well versed with the Jira Java API and ScriptRunner but am newer to the Confluence API, but I have noticed much overlap.
// page is an instance of com.atlassian.confluence.core.ContentEntityObject
DefaultRenderer renderer = ComponentLocator.getComponent(DefaultRenderer);
String content = renderer.render(page)
Hi Brian, the above snippet will render the content of a page to XML (see caveat about it being imperfect). I am not exactly certain how to send an e-mail using the Confluence Java API. We are using an program called Sendy to send these newsletters out. It has a simple REST API to use.
Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events