@NonInjectableComponent public interface MailAttachmentsManager
Modifier and Type | Field and Description |
---|---|
static String |
CID_PREFIX
Content-ID for generated attachments.
|
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
|
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 inline image specified by path and add it to email attachments or add JWT token
|
boolean |
hasSecuredImage()
Needed to attach/or not
Use only after
inlineImages(String) as it will count found images in rendered html. |
String |
inlineImages(String html)
Deprecated.
use
processImages(String) instead. Will be removed in Jira 9.0 because name of this method no longer relevant. Removing this method will affect mail templates |
String |
processImages(String html)
- Looks for tags and tries to inline image if it's an internal resource.
|
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.
|
static final String CID_PREFIX
String getAvatarUrl(String username)
username
- String getAvatarUrl(TemplateUser templateUser)
templateUser
- String getAvatarUrl(ApplicationUser user)
user
- String getAvatarUrl(@Nonnull Avatar avatar, @Nonnull Avatar.Size size, String avatarOwnerDescription)
Avatar
(icon for project or some other entity in Jira) in email message.avatar
- Avatar
to display in emailsize
- avatar sizeavatarOwnerDescription
- Description of avatarString addAttachmentAndReturnCid(MailAttachment mailAttachment)
mailAttachment
- String getImageUrl(String path)
path
- String removeBaseUrl(String url)
url
- the url to remove the baseUrl from@Deprecated String inlineImages(String html)
processImages(String)
instead. Will be removed in Jira 9.0 because name of this method no longer relevant. Removing this method will affect mail templatesString processImages(String html)
- Looks for tags and tries to inline image if it's an internal resource. Otherwise adds JWT token for every /secure/* image or leaves unchanged for other paths.
- Counts how many images there are that start with /secure/* so hasSecuredImage()
can calculate the result needed to construct email footer
- Adds default 'alt' attribute which is an attachment file name in case img has none
html
- HTML to change.String getExternalImageUrl(String path)
int getAttachmentsCount()
boolean hasSecuredImage()
inlineImages(String)
as it will count found images in rendered html.Iterable<javax.mail.BodyPart> buildAttachmentsBodyParts()
Copyright © 2002-2024 Atlassian. All Rights Reserved.