class MailDelegate extends java.lang.Object
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
PLACEHOLDER_TO |
Constructor and description |
---|
MailDelegate() |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
addAttachment(java.io.File file, groovy.lang.Closure specification) Add an attachment to the mail. |
|
java.lang.String |
addAttachment(java.lang.String path, groovy.lang.Closure specification) Add an attachment to the mail. |
|
java.lang.String |
addAttachment(com.atlassian.jira.issue.attachment.Attachment issueAttachment) Add an attachment to the mail from an Issue attachment. |
|
com.atlassian.mail.Email |
getEmail() |
|
void |
setBcc(java.lang.String[] addresses) Set one or more "bcc" users, in the form jbloggs@example.com |
|
void |
setBcc(com.atlassian.jira.user.ApplicationUser[] users) Set one or more "bcc" recipients |
|
void |
setBody(java.lang.String body) Sets the email body |
|
void |
setCc(java.lang.String[] addresses) Set one or more "cc" users, in the form jbloggs@example.com |
|
void |
setCc(com.atlassian.jira.user.ApplicationUser[] users) Set one or more "cc" recipients |
|
void |
setFrom(com.atlassian.jira.user.ApplicationUser user) Set the user this message will be sent from. |
|
void |
setHtml() Marks the email as containing HTML. |
|
void |
setPlainText() Marks the email as containing plain text. |
|
void |
setSubject(java.lang.String subject) Sets the email subject |
|
void |
setTo(java.lang.String[] addresses) Set one or more "to" users, in the form jbloggs@example.com |
|
void |
setTo(com.atlassian.jira.user.ApplicationUser[] users) Set one or more "to" recipients |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Add an attachment to the mail. If you want to embed an image into an HTML mail, you can use the return value from this method. Example:
Mail.send { setTo('foo@example.com') setHtml() setBody("<b>foo</b> <img src='cid:${addAttachment("/path/to/image.png")}' />") }
path
- the path to the filespecification
- an optional closure which delegates to javax.mail.internet.MimeBodyPart, for example setFileName('myname.txt')
Add an attachment to the mail. If you want to embed an image into an HTML mail, you can use the return value from this method. Example:
Mail.send { setTo('foo@example.com') setHtml() setBody("<b>foo</b> <img src='cid:${addAttachment("/path/to/image.png")}' />") }
path
- the path to the filespecification
- an optional closure which delegates to javax.mail.internet.MimeBodyPart, for example setFileName('myname.txt')
Add an attachment to the mail from an Issue attachment. If you want to embed an image into an HTML mail, you can use the return value from this method. Example:
Mail.send { setTo('foo@example.com') setHtml() setBody("<b>foo</b> <img src='cid:${addAttachment(issueAttachment)}' />") }
issueAttachment
- issue attachmentSet one or more "bcc" users, in the form jbloggs
Set one or more "bcc" recipients
users
- Jira users to send mail toSets the email body
Set one or more "cc" users, in the form jbloggs
Set one or more "cc" recipients
users
- Jira users to send mail toSet the user this message will be sent from. You can change the name displayed using setFromName(java.lang.String).
user
- from userMarks the email as containing HTML. When this is set, use an HTML string in setBody(java.lang.String) .
Marks the email as containing plain text. This is the default.
Sets the email subject
Set one or more "to" users, in the form jbloggs
Set one or more "to" recipients
users
- Jira users to send mail to