Trigger emails to the group members alone from a scheduled job

Ramkumar Thanga
Mega Sage

Hi,

 

I am passing the sys_id of the group as Event parm1, using gs.eventQueue from a scheduled job.

The event is getting triggered and the notifications are sent to the group members and also to the group manager.

How can I stop sending emails to group manager, the email has to be sent to the group members alone.

 

Thanks!
Ram

11 REPLIES 11

shantanu_patel8
Mega Guru

@Ramkumar Thanga 

 

The group manager in a way is also the group member so if you want to exclude the manager you will need to query the group members and send the notifications to them like how you send the notifications to users.

 

Please mark the answer helpful and correct if it helps the issue. Happy scripting 🙂

-Shantanu

@shantanu_patel8 , I am doing the same through a Business Rule to trigger the event but there the email is being sent only to the group members not to the manager of the group.

 

But in scheduled job, it includes the manager of the group.

 

Thanks!
Ram

It could be because of the "run as" field in scheduled job vs the user through which the business rule is getting triggered. The user in business rule might not have the access to manager field or profile hence the mail is not being sent to manager. 

 

You will need to debug the user through which you are triggering the event.

 

Please mark the answer helpful and correct if it helps the issue. Happy scripting 🙂

-Shantanu

Shubhras
Tera Contributor

Hello @Ramkumar Thanga 
You need to check the exclude manager field in Group Form. By doing this the manager will not get the mail sent to the group.

 

Kindly mark my answer as helpful and accept solution if it helped you. 

 

 

Thanks,
Shubhra Saxena