Sending mails with images using MailAttachmentsManager Edited

Hi, I'm developing a postfunction that creates and sends an e-mail and I want to include the avatar of the user. I found the interface MailAttachmentsManager, but I haven't found any examples of how to create the object. I've tried this:

 

JiraHome jiraHome = new DefaultJiraHome();
AvatarTagger avatarTagger = new AvatarTaggerImpl(jiraHome);
AvatarTranscoder avatarTranscoder = new AvatarTranscoder(ComponentAccessor.getAvatarManager(), avatarTagger);
MailAttachmentsManager mailAttachmentsManager = new MailAttachmentsManagerImpl(ComponentAccessor.
getAvatarService(), avatarTranscoder, ComponentAccessor.getUserManager(), ComponentAccessor.getAvatarManager(), ComponentAccessor.getApplicationProperties());

But, I get the error: java.lang.InstantiationError: com.atlassian.jira.avatar.AvatarTranscoder

can anybody help me?

 

2 answers

This widget could not be displayed.

Hi Pablo - if you don't get an answer here, consider also asking this over at: https://community.developer.atlassian.com (if you haven't already).

You can read more about the Developer Community in this article: https://community.atlassian.com/t5/Feedback-Forum-articles/The-Atlassian-Developer-Community/ba-p/459061

This widget could not be displayed.

Thank Sam. I tried to ask in the community, but they disabled my account and my question disappeared.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Canada

AUG Lunch Roundtable - August 13 - Highlights

Thanks to everyone who came out today for the lunch AUG - we had some great food and discussion (and ice cream sandwiches to fend off the heat!) The welcome and fun fact was great as well, what an aw...

28 views 1 3
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you