- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 02:01 AM
Hi,
I want to send a email notification to Author which how to get knowledge articles which will expire in next 4 days.
Want to send a email notification to author.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 02:32 AM
Hi @SreenadhChenna ,
There is already a notification which triggers based upon the scheduled job 'Notification for Article Expiry Warning' which is fired by event 'kb.article.expiry.warning', but this only runs monthly.
So you'd want to consider creating a new event for that and use a separate scheduled job to check within 4 days u can refer below solution for that,
- Create a scheduled Script like below (I have kept it to execute daily, u can modify how frequent it is suppose to run)
- Create a event in event registry table from which the notification will be triggerred.
- Lastly Create 1 notification
in what to send u can update with your required mail body.
Please mark my answer helpful & accepted if it resolves your query.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 02:30 AM
Hello @SreenadhChenna ,
You can create a schedule job and write the below code.
Notify();
function notify() {
var gr = new GlideRecord('kb_knowledge');
gr.addQuery("valid_to", "<", gs.daysAgoStart(-4));
gr.addQuery("valid_to", ">", gs.now());
gr.query();
while (gr.next())
gs.eventQueue("article.expiring.4days", gr, "", "");
}
´Thank you,
Omkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 02:32 AM
Hi @SreenadhChenna ,
There is already a notification which triggers based upon the scheduled job 'Notification for Article Expiry Warning' which is fired by event 'kb.article.expiry.warning', but this only runs monthly.
So you'd want to consider creating a new event for that and use a separate scheduled job to check within 4 days u can refer below solution for that,
- Create a scheduled Script like below (I have kept it to execute daily, u can modify how frequent it is suppose to run)
- Create a event in event registry table from which the notification will be triggerred.
- Lastly Create 1 notification
in what to send u can update with your required mail body.
Please mark my answer helpful & accepted if it resolves your query.
Thanks,
Danish