Creating a Scheduled Notification

Felipe Benevid1
Giga Contributor

Good afternoon people,

I am trying to generate a scheduled notification where only the email would be triggered when the date was equal to the date included in a record field.

Example: A notification when the user is birthday.

Is it possible to create a notification like the example above?

Thank you.

1 ACCEPTED SOLUTION

Prateek kumar
Mega Sage

Hello Felipe


Try something like this


1. system policy> events> registry


Event name: user_birthday


2. System definition>Scheduled jobs


Run: Daily


Script:


var date = "u_birthdayONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)"; // get this encoded query depending on your field on user table


var gr = new GlideRecord('sys_user');


gr.addEncodedQuery(date);


gr.query();


while(gr.next())


{


//gs.log(gr.email ,'prateek_new');


gs.eventQueue("user_birthday",gr, gr.email);


}


3.System Notification>Email> notifications


Name: Your custom name


Table: sys_user


1.When to send


send when: event is fired


event name: user_birthday


2.Who will receive


event parm1 contains recipient: checked


send to event creator: checked


3. What it will contain


Depending on your requirement



Try this out and let me know the results



Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

5 REPLIES 5

Prateek kumar
Mega Sage

Hello Felipe


If we did answered your question, please mark the appropriate response as correct and close this thread. This helps community.



Please mark my response as correct and helpful if it helped solved your question.
-Thanks