- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 03:58 AM
When the user account is Locked in user table and if that user tries to send an email to any specific email address then user should an get an email stating that your account is locked.
on user table before insert and update
please verify my code and let me know because the code is not working in bs rule:
Condition : current.user_account_locked_out== true
(function executeRule(current, previous /*null when async*/) {
var email = current.email;
var subject = "Your account is locked";
var message = "Your account has been locked. Please contact IT to unlock your account.";
gs.eventQueue("email.send", current, email, subject, message);
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 10:41 PM
Hello @Yougander patel ,
What is the issue did you check sys_email table if the email was recieved by the ServiceNow instance.
Please share the screenshot of the email log. so that I can assist you further.
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 12:51 AM
Hi Nayan ,
i Tried by using your tip but its not working
Steps:
table:sys_eamail
under conditions: UserID.Lockout is true and Recipents startswith my "devinstnace email id"
created an email template and added and saved it and next
i created dummy user and given a Gmail account and i make dummy user to be lockout in dev instance
and then i mail to dev instance from my email account but unable to receive notification in return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 10:41 PM
Hello @Yougander patel ,
What is the issue did you check sys_email table if the email was recieved by the ServiceNow instance.
Please share the screenshot of the email log. so that I can assist you further.
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.