The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Email Notification sent to Updated By and Created By persons:

Sankrupa
Mega Expert

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 .

1 ACCEPTED SOLUTION

It didnt work that way. But tried passing as event parameter and working. Thanks for your help.


View solution in original post

8 REPLIES 8

randrews
Tera Guru

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.


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.


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


Yeah. That I was trying with the mail script to cc the user but didn't succeed.