Hi , I am sending the teams nudge using moveworks send_message API, the nudge only works for 1 email id not for multiple. can someone please help here.
following is the code for the reference.
var recipientEmail = event.parm1;
// value being passed in event.parm1 is -> email1@example.com,email2@example.com
var summary = event.parm2;
// nudge works with following hard coded values
// emailRecipient = ["email1@example.com", "email2@example.com"];
// following code is to get the list of string
var colSplit = recipientEmail.split(",");
// logging result is [colSplit 1 -- object]
gs.log("colSplit 1" + "--" + typeof colSplit);
var arr = [];
for (i = 0; i < colSplit.length; i++) {
arr.push(colSplit[i]);
}
try {
var moveworksAPI = new MoveworksApiSdk();
// nudge only works for 1 email id, not for multiple
moveworksAPI.send_message(arr, summary.toString(), event_id);
} catch (ex) {
var message = ex.message;
gs.log("Error: " + message + " Recipient email" + recipientEmail, "moveworks.error");
}