e-mail notification from an event..

Srikanth Menava
Kilo Sage

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.

1 ACCEPTED SOLUTION

Srikanth Menava
Kilo Sage

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,



not.PNG


This helped me to achieve the requirment ,,
just in case if anyone have the same requirement.. Hope this will help them..


View solution in original post

18 REPLIES 18

David OBrien
Kilo Guru

Where are you triggering the notification from?   Is it a scheduled job?   Is there an option to pass in the counter as a parameter in the event you're triggering the notification with?


Hello David,


I am triggering the notification from Event, I am not familiar with how to pass counter as a parameter. Any help is much appreciated.


What is triggering the event to run?   That is where you would pass it in.   gs.eventQueue('<event_name>',<record>,<parameter1 -- i.e. counter>,<parameter2>);


A condition I worte is triggering the event to run,


for example when creating an incident, if the catageory is software it will trigger an event that sends notification, and also event should trigger untill the incident catageory changes from 'software'.(might be to any other)


I hope I am clear,


Any help will be much appreciated.