- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 03:35 PM
I wrote a recurring email - notification. I need a count of the notification in the email body..
To be precise I wrote an email notification that occurs continuously untill a specific condition is met. So, now what i need is to get the number in the email body.. i.e., if the email got triggered for the first time it needs to say 1st notification, and if its for the second time we need to say 2nd notification, so on.,
I hope I am clear, and I will get the answer for this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2017 12:35 PM
I achieved this by using the email scripts.. and using that email script reference in the notification..
here is the script...
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var count = event.parm2.toString();
if(count>0){
template.print("This is "+count+" reminder.");
}
})(current, template, email, email_action, event);
and I called this script in the 'what it will contain' in the notification,
This helped me to achieve the requirment ,,
just in case if anyone have the same requirement.. Hope this will help them..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 05:12 PM
n=counter; (Default = 0)
n=1 - Notification to User (creator of incident)
n=2 - Notification to User and Manager(notification 1)
here, i wrote a rollback function i workflow to check for the status (catageory field, untill unless it changes the notification should continue firing,)
n=3 - Notification to User and manager (saying notification 2)
n=4 - Notification to User and manager (saying notification 3)
Makes sense but ccan you make it a bit clear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 05:25 PM
You can use the same logic - But, in the notification use it as (n-1).
notificationCounter = 0;
notificationCounter = 1 - Notification to User (creator of incident)
notificationCounter = 2 - Notification to User and Manager(notification 1 = (notificationCounter-1))
here, i wrote a rollback function i workflow to check for the status (catageory field, untill unless it changes the notification should continue firing,)
notificationCounter = 3 - Notification to User and manager (saying notification 2 = (notificationCounter-1))
notificationCounter = 4 - Notification to User and manager (saying notification 3 = (notificationCounter-1))
Makes better sense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 08:53 PM
Hi Srikanth, using a scratchpad variable is a good approach to this as per me. I can understand that for every turn you have to send two notifications one for manager and other for user. There will be a different key in the subject line for the user mail and manager mail when a notification is triggered, I believe. So we can store two scratchpad variables one for managerMailCounter , userMailCounter, and you can use the subject key in if condition to conditionally update the two counters and use others suggestion to make it fulfilled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2017 12:35 PM
I achieved this by using the email scripts.. and using that email script reference in the notification..
here is the script...
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var count = event.parm2.toString();
if(count>0){
template.print("This is "+count+" reminder.");
}
})(current, template, email, email_action, event);
and I called this script in the 'what it will contain' in the notification,
This helped me to achieve the requirment ,,
just in case if anyone have the same requirement.. Hope this will help them..