Highlighted
Absent Member.
Absent Member.
576 views

(SM) Support Tip : JavaScript variables in "Send HTML email" rule

Hi All,

 

Imagine the situation you've got multiple email addresses without being assigned neither to a contact nor an operator and you need to send out HTML notification to them for IM, SD, etc…

So you need to set a variables in the JavaScript option that defines the recipients addresses in the HTML email rule.

 

The syntax is:

 

users[0]="user1@gmail.com";

users[1]="user2@gmail.com ";

users[2]="user3@gmail.com ";

users[3]="user4@gmail.com ";

 

 

BR,

Alex

If you find this post useful/helpful click the Kudo star on this post!

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Labels (1)
1 Reply
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: (SM) Support Tip : JavaScript variables in "Send HTML email" rule

Alex, I've tried to do this, and received error messages such as "users not defined."  I'm trying to do this in a for loop, like so:

for (var i = 0; i < arrayLength; i++) {
   print("CI: "+assetStringArray[i]);
   users[i]=lib.xcelUtilities.GetGroupApprovers(assetStringArray[i]);
   print ("Users: "+users);
}

If I do it without the index, it will only send to the last group members in the array.

What am I doing wrong?

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.