I found sample code to perform this task in the sample template "Issue
Tracking: Detailed". Here is the code:
/*------------------------------------------------------------------------------
This function handler is generated and managed automatically.
Do not rename the function or alter its parameter list
------------------------------------------------------------------------------*/
function SendEmailBtn::OnClick(oEvent)
{
createEmail();
}
function createEmail()
{
var xmlContributors =
XDocument.DOM.selectNodes("/iss:issue/iss:contributors/iss:contributor");
var xmlContributor;
var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
var rgRecipients = new Array();
while (xmlContributor = xmlContributors.nextNode()
rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("iss:emailAddressPrimary")));
try
{
var oEnvelope = XDocument.View.Window.MailEnvelope;
oEnvelope.To = rgRecipients.join("; ");
oEnvelope.Subject = getNodeValue(xmlTitle);
oEnvelope.Visible = true;
}
catch (ex)
{
XDocument.UI.Alert(ex.description);
}
}