- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:20 PM
Hello
I want to send multiple values like 8 to 10 values from my script include to email body of Notifications. I am using event triggering based approach. How to send this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:39 PM
What type of values?
One example would be to create a JSON object, send that and handle the values in email script.
For example:
obj = {};
obj.value1 = "value1";
obj.value2 = "value";
objString = JSON.stringify(obj);
gs.eventQueue('event_name, current, objString, "");
In your event you pass the objString and then in the email script you can parse it as:
var obj = JSON.parse(event.parm1);
//Then you can either loop it or access the values how you want.
for(var i in obj){
template.print(obj[i]);
}
//or
template.print(obj.value1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 01:29 AM
Hello,
In notification -> What it will contain section, you can make use of mail script like this
And you can create the email script to fetch the values from the object
If my response resolves your issue please mark correct or helpful.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:39 PM
What type of values?
One example would be to create a JSON object, send that and handle the values in email script.
For example:
obj = {};
obj.value1 = "value1";
obj.value2 = "value";
objString = JSON.stringify(obj);
gs.eventQueue('event_name, current, objString, "");
In your event you pass the objString and then in the email script you can parse it as:
var obj = JSON.parse(event.parm1);
//Then you can either loop it or access the values how you want.
for(var i in obj){
template.print(obj[i]);
}
//or
template.print(obj.value1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 12:06 AM
@Weird Thank you for your approach. I created a list say of fruits in my script include.
var list1 = ['Mango', 'Grapes', 'Pomegranate'];
var sendList1 = JSON.stringify(list1);
gs.eventQueue('x_1043123_needlt.eventForSendingMail', current, sendList1, '');
Now I want to know how to fetch this value in my "What it will contain" section in Notification.
Where to write
var obj = JSON.parse(event.parm1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 01:29 AM
Hello,
In notification -> What it will contain section, you can make use of mail script like this
And you can create the email script to fetch the values from the object
If my response resolves your issue please mark correct or helpful.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 04:32 AM
Thankyou @Community Alums This worked. One more help how to insert a new line in template.