- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 08:44 AM
I am trying to send email notification to the user who created and updated the record. For that I have created a email notification which triggers the event and send the notification to the person who is logged in and to the specific group. But, now my requirement is to send the email notification to the person who created the record when the other person updates the record. I tried implementing with the mail script with addAddress which takes address from created by field and updated by field. But, its not working. Following is the mail script that I used for the notification.
var user =new GlideRecord('sys_user');
user.addQuery('user_name', current.sys_created_by);
user.query();
while(user.next()){
//add to cc list
email.addAddress('cc', user.email, user.getDisplayValue());
}
Could you please guide me.
Thank You .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 09:27 AM
It didnt work that way. But tried passing as event parameter and working. Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 08:55 AM
no need to script this.. put both in the to field.. and check the do not send to event creator
now if someone updates the record.. the opened by gets an email... if the opened by updates the record the last person to update it gets an email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 09:08 AM
Hi,
The notification is on the custom table and it doesn't have the opened by field and I did check the send to event creator checkbox.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 09:12 AM
ok if you don't have an opened by you will have a sys_created_by so you can use a script to look up the user id stored there.. find the user and if they didn't update it add them to the recipients/cc them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 09:17 AM
Yeah. That I was trying with the mail script to cc the user but didn't succeed.