email notification for impersonate users

sanjay42
Tera Contributor

Hi,

I need when admin check with impersonate user while select anyone user then email send to that impersonate user.. with message like one of admin(name) accessed your account with admin access...

i am searched in community for this i got

How to Enable Email Notification on Impersonation Event

but in this article configured u_impersonation table but in my instance i don't   have that table..

Thanks

Sanjay

1 ACCEPTED SOLUTION

Hi Sanjay,



You can create a new notification for the same using OOB events called "impersonation.start" and "impersonation.end"



Name : Impersonate User


Table : User {The event impersonation.start is registered to this table}


Send When : Event is fired


Event Name : impersonation.end


Users : admin //you can keep any user you want to send


Send to event creator : checked


Subject : Account was impersonated.


Message HTML :



<mail_script>


var gr = new GlideRecord('sys_user');


var abc = event.parm2;


gs.log(abc,"mru");


gr.addQuery('user_name',abc);


gr.query();


if(gr.next())


{


template.print("Hi "+gr.first_name+",");


email.addAddress('cc',gr.email);


}


</mail_script>



Your account was impersonated using ${event.parm1} account.


View solution in original post

11 REPLIES 11

sanjay42
Tera Contributor

thanks Mrudula,



Its working, but i have a doubt we can use Event Name : impersonation.end,



what is the meaning of this statement i know we select user table but with in braces i can't understand.


Table : User {The event impersonation.start is registered to this table}



regards


sanjay


Hi Sanjay,



Glad it worked



We can use the event impersonation.end as well. As for the statement, if you check in the event registry for "impersonation.end", it is associated with table "user"


This does not imply that you have to select User table ONLY in your notification.



Since it resolved your issue, please mark the answer as correct so it can close the question and help others facing same issue.