public class MailAttachmentsManagerImpl extends Object implements MailAttachmentsManager
CID_PREFIX
Constructor and Description |
---|
MailAttachmentsManagerImpl(AvatarService avatarService,
AvatarTranscoder avatarTranscoder,
UserManager userManager,
AvatarManager avatarManager,
ApplicationProperties applicationProperties) |
Modifier and Type | Method and Description |
---|---|
String |
addAttachmentAndReturnCid(MailAttachment mailAttachment)
Adds an attachment to the mail attachments manager's collection of attachments.
|
Iterable<javax.mail.BodyPart> |
buildAttachmentsBodyParts()
Builds bodyPart for each image (including avatars) added to this manager
|
protected String |
getAbsoluteUrl(String path) |
int |
getAttachmentsCount()
Returns the number of attachments added to this manager
|
String |
getAvatarUrl(ApplicationUser user)
Returns a link to access user avatar in email message.
|
String |
getAvatarUrl(Avatar avatar,
Avatar.Size size,
String avatarOwnerDescription)
Returns a link to access
Avatar (icon for project or some other entity in Jira) in email message. |
String |
getAvatarUrl(String username)
Returns a link to access user avatar in email message.
|
String |
getAvatarUrl(TemplateUser templateUser)
Returns a link to access user avatar in email message.
|
String |
getExternalImageUrl(String path)
If the path is a relative url tries to add the image specified as an attachment.
|
String |
getImageUrl(String path)
Tries to add image specified by path to email attachments.
|
String |
getIssueTypeIconUrl(IssueType issueType) |
String |
inlineImages(String html)
Tries to inline all the images specified by an IMG tag.
|
String |
removeBaseUrl(String url)
Tries to remove the baseUrl (eg: http://example.com/jira) or the basePath (/jira) from an URL, and return the
result.
|
public MailAttachmentsManagerImpl(AvatarService avatarService, AvatarTranscoder avatarTranscoder, UserManager userManager, AvatarManager avatarManager, ApplicationProperties applicationProperties)
public String getAvatarUrl(String username)
MailAttachmentsManager
getAvatarUrl
in interface MailAttachmentsManager
public String getAvatarUrl(TemplateUser templateUser)
MailAttachmentsManager
getAvatarUrl
in interface MailAttachmentsManager
public String getAvatarUrl(ApplicationUser user)
MailAttachmentsManager
getAvatarUrl
in interface MailAttachmentsManager
public String getAvatarUrl(@Nonnull Avatar avatar, @Nonnull Avatar.Size size, String avatarOwnerDescription)
MailAttachmentsManager
Avatar
(icon for project or some other entity in Jira) in email message.getAvatarUrl
in interface MailAttachmentsManager
avatar
- Avatar
to display in emailsize
- avatar sizeavatarOwnerDescription
- Description of avatarpublic String addAttachmentAndReturnCid(MailAttachment mailAttachment)
MailAttachmentsManager
addAttachmentAndReturnCid
in interface MailAttachmentsManager
public String getImageUrl(String path)
MailAttachmentsManager
getImageUrl
in interface MailAttachmentsManager
public String inlineImages(String html)
MailAttachmentsManager
inlineImages
in interface MailAttachmentsManager
html
- HTML to change.public String removeBaseUrl(String url)
MailAttachmentsManager
removeBaseUrl
in interface MailAttachmentsManager
url
- the url to remove the baseUrl frompublic String getExternalImageUrl(String path)
MailAttachmentsManager
getExternalImageUrl
in interface MailAttachmentsManager
public int getAttachmentsCount()
MailAttachmentsManager
getAttachmentsCount
in interface MailAttachmentsManager
public Iterable<javax.mail.BodyPart> buildAttachmentsBodyParts()
MailAttachmentsManager
buildAttachmentsBodyParts
in interface MailAttachmentsManager
Copyright © 2002-2022 Atlassian. All Rights Reserved.