You need to sign in to do that
Don't have an account?

How to send an email to public groups under queue
HI Experts,
Can anyone help me out, how can i send an email to public group users under a queue based on language. Thanks in advance
Can anyone help me out, how can i send an email to public group users under a queue based on language. Thanks in advance
You Can go ahead with Workflow,ProcessBuilder or Flow to Achieve this Functionality
In WorkFlow Rule :
1.Set the Object -> Set when it will Fire -> put Condition if Language is 'English' and add more Conditons if need.
2.Actions : Choose Email Templete -> Choose Receipent Type : Public Group (Make Sure You Group Email id Should be null otherwise Email Send to the your Group Email not Group of Users).
Thanks
Mohamed Ithris
I want to send an emails of public group users of an queue based on user language
Then you will go to Customization in the Apex.
1.Send an Email using Apex
2.Write the If conditions and get the Public Group Users from Queue
Send an Email Using Apex :
public class EmailSender {
public void sendMail() {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(getEmailAddresses());
mail.setSubject('This is the subject');
mail.setPlainTextBody('This is the body.');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
private List<String> getEmailAddresses() {
List<String> idList = new List<String>();
List<String> mailToAddresses = new List<String>();
Group g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = 'MyPubGroup'];
for (GroupMember gm : g.groupMembers) {
idList.add(gm.userOrGroupId);
}
User[] usr = [SELECT email FROM user WHERE id IN :idList];
for(User u : usr) {
mailToAddresses.add(u.email);
}
return mailToAddresses;
}}
Get the Public Group Users from Queue
You need to Write sub Query or Multiple Query
Here I put MultipleQuery to get the Public group Users of an Queue
All Queries are depened
1.SELECT Id, Name FROM Group where Type = 'Queue' AND Name = 'Billing Support Queue' - Got your Queue
2.SELECT Id, Name FROM Group where Type = 'Group' Name = 'Billing Support Group' - Got your Group
3.SELECT Id, GroupId FROM GroupMember where GroupId = '00G7F000003YTH***'and Id = '0117F000001j3***' - Got your Group id from the Queue
When I do Test Deliverability I have information- 16 test messages have been sent to this email address.
I open receved mail I I only don't habe this user email adress.
Where is the problem??
hello, I have users in public group, I sent a messages to public group. One user did not receive mail .
When I do Test Deliverability I have information- 16 test messages have been sent to this email address.
I open receved mail I I only don't have this user email adress.
Where is the problem??