I want to send a email notification to Author whihc how to get knowledge articles whihc will expire

SreenadhChenna
Tera Contributor

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,

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

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.

DanishBhairag2_0-1695374326924.png

 

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)

DanishBhairag2_1-1695374819586.png

  • Create a event in event registry table from which the notification will be triggerred.
  • Lastly Create 1 notification 

DanishBhairag2_2-1695374937562.pngDanishBhairag2_3-1695375015569.png

 

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

View solution in original post

2 REPLIES 2

Omkar Kumbhar
Mega Sage
Mega Sage

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

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Danish Bhairag2
Tera Sage
Tera Sage

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.

DanishBhairag2_0-1695374326924.png

 

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)

DanishBhairag2_1-1695374819586.png

  • Create a event in event registry table from which the notification will be triggerred.
  • Lastly Create 1 notification 

DanishBhairag2_2-1695374937562.pngDanishBhairag2_3-1695375015569.png

 

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