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

I'm upgrading Bamboo from v5.4.2 to v5.14.3.1 and wanted to know how can I send an email from a custom plugin

Michael Chidzik February 3, 2017

I am upgrading Bamboo and have a custom plugin that I'd like to send email but I'm having a hard time getting it to work. Is there any developer documents or examples that I can take a look at to get this working?

3 answers

1 accepted

1 vote
Answer accepted
Justin Shapiro
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.
February 6, 2017

If he can't do it the way he was doing it perhaps this might work? 

 

Email email = new Email(recipient).setSubject(subject).setBody(message); 

eventPublisher.publish(new EmailEvent(this, email));

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2017

BambooMailer is a Spring bean that was never available to plugins and you're not supposed to initialize it manually. You'll have to send the email using standard Java APIs.

I don't see why it shouldn't be made available to plugins - feel free to open an improvement request at jira.atlassian.com

 

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2017

Is there a specific problem you have with that plugin?

Michael Chidzik February 3, 2017

I can't instantiate BambooMailer. Prior to v5.10 it was a no argument constructor.

 

bambooMailer = new BambooMailer(new EmailService(new XMLMailServerManager())); gives a signature mismatch

bambooMailer = new BambooMailer(new EmailService(new BambooMailServerManager())); gives a signature mismatch

BambooMailServerManager bambooMailServerManager = new BambooMailServerManager();
SMTPMailServer mailServer = bambooMailServerManager.getDefaultSMTPMailServer(); gives a NPE

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events