Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I send email using confluence java api?

ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2011

Hi,

I want to send e-mail to user whenever some action is triggered. How can I achive that using confluence? Or should I use some external java library like java mail?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2011

I solved my problem with com.atlassian.core.task.MultiQueueTaskManager and com.atlassian.confluence.mail.template.PreRenderedMailNotificationQueueItem classes. With PreRenderedMailNotificationQueueItem class (and a template) you can create the message. Then you should

email.render(); and

multiQueueTaskManager.addTask("mail", email); it.

Do not forget to configure your SMTP Server in administration panel.

Ibrahim hussam June 11, 2015

email.render()? where is that?

0 votes
ket.pjwstk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2011

Well ... I do not have access to source code download. Anyway, what should I include in pom.xml to obtain *.jar with class mentioned above?

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 11, 2011

If you have bought license to Confluence, you can download the source from http://my.atlassian.com/

I'd rather not paste the source code here. Sorry.

Alain Moran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2011

You get access to the confluence source with the $10 starter licenses - there's really no point in trying to struggle along without it ;)

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 11, 2011

Download the Confluence source code and take a look at:
com.atlassian.confluence.ext.mailpage.MailPageAction

Likely, you want to wrap your code in an Event Listener.

Read the documentation: Writing an Event Listener Plugin Module

TAGS
AUG Leaders

Atlassian Community Events