Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...


Warning

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !


Info
titleAvailability

This routine is available starting with SIL Engine™ 1.0, changed in 1.1.14 for Jira 4.3.x / 4.4.x and 2.0.7 for Jira 5.x.

...

sendEmail(from, to, cc, subject, body_or_template, language, issue_key, regex_array)

sendEmail(from, to, cc, subject, body_or_template, language, wildcard_path_array)

Or

sendEmail(JEmailMessage)

...

If you don't specify the language parameter and you use templates, by default the messages are sent in the sender defined language. For the users that are Jira users ('to' or 'cc' are user names and not email addresses) the language defined in the user profile(for each user) is used for email sending. For the rest of the users the email is sent using the sender defined language.

...

Parameter name

Type

Required

Description




JEmailMessage








JEmailMessage







yes







Predefined email message structure. The structure contains the following fields
Field NameField TypeRequiredDescription
tostring []yessee above
ccstring []nosee above
bccstring []nosee above
subjectstringyessee above
messagestringyessee above
fromstringnosee above
attachmentsJEmailAttachment []nosee above
plainTextbooleannoforces sending email in plain text format


Alias

For historical reasons, this routine may be named 'sendEmailFrom'.

...

Code Block
sendEmail("santa@cprime.com", {"jira-users"}, {}, "santa_subject.tpl", "santa_letter.tpl", "en_US", key, {"attachment.*"}); 

...

Code Block
sendEmail("santa@cprime.com", {"jira-users"}, {}, "santa_subject.tpl", "santa_letter.tpl", "en_US", key, {"attachment.\\.txt"}); 

...

Code Block
sendEmail("santa@cprime.com", {"jira-users"}, {}, "santa_subject.tpl", "santa_letter.tpl", "en_US", key, {"attachment1\\.txt", "attachment3atxt"}); 

...

Here is the same example that includes adding attachments to the email. This requires the use of the JEmailAttachment structure type.

Code Block
JEmailMessage email;
email.to = {"testJiraUser1", "testEmail@cprime.com", "testJiraUser2"};
email.subject = "Email to Santa";
email.message = "Dear Santa, I want a train.";


for(string a in attach) {   
    JEmailAttachment att;
    att.name = a;
    att.file = getAttachmentPath(key, a);
    email.attachments += att;
}

sendEmail(email);

...