- 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 03:56 PM
Hello Jonathan,
I hope you didn't get my question properly.. I dont want a counbter field on a record,, what I want is I should get a counter on the email notification body...
If the notification is for 10 th time it should show 10th remainder in the body of the e-mail.
and If the notification is for 46 th time it should show as 46th remainder in the body of the e-mail.
hope this will give a very clear picture of my requirement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 04:00 PM
Yes, I understand your requirement, but you have to store that counter somewhere because these events are stateless in a sense. You have to have somewhere to store that counter so you can continually access it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 03:47 PM
- Create an integer field on the table you are trying to trigger an event off. Set the default value of the field to 0.
- Every time you trigger the event, increment the value prior to event trigger and use that field in the body of the notification.
Hope this helps.
Thank-you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 04:17 PM
Hello Nishant,
I really appreciate your approach, I have two notification triggering, depending on the same field i.e., 1st notification to user(creater of the incident) and 2nd notification to user and his manager( this notification needs to be recurring until the field value changes){this is where I need the count in the body}.
We can not do the way you proposed.
Any further help is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 04:40 PM
So, to understand better -
n=counter; (Default = 0)
n=1 - Notification to User (creator of incident)
n=2 - Notification to User and Manager
n=3 - Notification to User
You can use if conditions or Switch statements to drive what notification to trigger.