How to pass user in eventQueue

Preethi26
Tera Contributor

Hi Team,

I am trying to schedule a job that remove users groups and roles who have not logged in for last 3 months.

But while working on notification im stuck as its new for me.

I have gave admin directly in user field of notification in this case its  sending notification for admin but not for specific users  for whom role/group is deleted.

Kindly correct me.

Preethi26_0-1701264133561.png

Preethi26_1-1701264389460.png

 

 

11 REPLIES 11

Hi @Anil Lande If active is not updated to false notification is sent to user

even if i put update line at the end also it is not triggering the emails.

I guess System does not send notifications to inactive users,

Then any way to update the active to false once the roles/groups removed.

Thank You

Mohan raj
Mega Sage

Hi @Preethi26,

 

In Scheduled job, current is not existing so it won't trigger an email.

 

Try this line to trigger email to specific user

 

gs.eventQueue( 'notify.user', null, "<sys_id of user to whom you need to send email>", "<sys_id of user to whom you need to send email>");

 

 

you can try above line of script in Background script to trigger an email.

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.

Hi,

Thank you but we dont want to hard code the sys id's.

Hi @Anil Lande If active is not updated to false notification is sent to user

even if i put update line at the end also it is not triggering the emails.

I guess System does not send notifications to inactive users,

Then any way to update the active to false once the roles/groups removed.

Thank You

@Preethi26 

 

Code shared by Anil is correct

but can you try to modify ā€˜gr’ instead of ā€˜current’ in the second parameter of event