How to pass user in eventQueue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 05:26 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 07:37 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 05:34 AM - edited ā11-29-2023 05:36 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 06:06 AM
Hi,
Thank you but we dont want to hard code the sys id's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 06:50 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-29-2023 07:14 AM - edited ā11-29-2023 07:14 AM
Code shared by Anil is correct
but can you try to modify āgrā instead of ācurrentā in the second parameter of event