YouTrack Standalone 2017.2 Help

Notifications

Workflow module Notifications from package @jetbrains/youtrack-scripting-api

Module containing facilities to send emails

Module functions

 

sendEmail

static sendEmail(message, message.fromName, message.toEmails, message.subject, message.body, issue)

Sends email

var issue = ctx.issue; if (issue.comments.added.isNotEmpty()) { var authorName = issue.comments.added.first().author.fullName; var message = { fromName: authorName, toEmails: ['user1@jetbrains.com', 'user2@jetbrains.com'], subject: 'New comment in ' + issue.id, body: [ '<div style="font-family: sans-serif">', ' <div style="padding: 10px 10px; font-size: 13px; border-bottom: 1px solid #D4D5D6;">', ' New comment was added in issue ' + issue.id + ' by ' + authorName, ' </div>', '<\div>' ].join('\n'); }; notifications.sendEmail(message, issue); }

Parameters:

NameTypeDescription
message Object contains message components that are required for sendout.
message.fromName string visible name of the message sender. Sender email address is set automatically based on the server "From" email and project "From" email settings.
message.toEmails Array.<string> list of recipient email addresses. The first email address in the array is set as the recipient. All others are set as CC.
message.subject string email subject.
message.body string email body.
issue Issue the issue that the email message is related to. All emails that are related to a single issue are combined into one thread.

 

Last modified: 9 August 2017