send email to group members when group manager is deactive

vivian08081
Giga Expert

Hi

I want to send out an email to notification all the members in the group when the group's manager is deactived.

I use client script to do the following action when the user record of the group manager is set to inactive.

1. set the group manager field to empty

2. delete the manager from the group member list

I want to greate an email, but which table should I use? Since I don't know how to set the value of who'll receive this email.

And could you also give some advice for create the event and business rule?

1 ACCEPTED SOLUTION

vivian08081
Giga Expert

Hi All


To solve this requirement, I add the group members to CC list and write the code into Email script.


Hope this could help you if you have the same requirement with me.


View solution in original post

11 REPLIES 11

Aakash Shah4
Tera Guru

Hi,



I assume you are done with the client script part.



Now to send the notification :



You can create a notification on the Group[sys_user_group] table.



In the who will receive tab add the group.


Since the the group will be containing an email ID and the group members of that group will receive the email notification.



Somewhat like this.



When to send:



find_real_file.png



Who will receive :



find_real_file.png


Hi Shah,



Thank you for your reply.



I want to send email to the group members who are in that group which the manager has been deactived to tell them the manager is leave the company and need to set a new one.



So I think I should create an event and a business rule to do it. But I don't know where and how to set the receiver based on my requirement.



Could you give out the detail steps for it?


First Create an Event from event registry


find_real_file.png



Create Business rule


find_real_file.png



Write this in the advanced tab



(function executeRule(current, previous /*null when async*/) {




// Add your code here


gs.eventQueue('manager.inactive',current,gs.getUserID(),gs.getUserName()); // to call the event




})(current, previous);



Finally the email notification



find_real_file.png



find_real_file.png


Thank you that's very useful for me.



But I still have question. How to send email to indiviual members to notifiy them the manager is inactive instead using the group email?