Set up workflow rules that specify which actions on a case send email alerts to team members.
From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
Click New Rule.
From Select object, choose Case and click Next.
Enter a rule name.
Choose the evaluation criteria. To ensure that every case is evaluated for an email alert, we recommend that you set the evaluation criteria to Evaluate the rule when a record is: created, and every time it’s edited.
Enter your rule criteria. We recommend that you choose criteria are met and select the criteria that a case must match to send email alerts. For example, if you want team members to receive an email alert each time a case’s status is set to New, set the criteria to Case: Status equals New.
Click Save & Next.
Add email alerts to your workflow rule’s criteria.
Click Add Workflow Action and choose New Email Alert.
Enter a description and unique name for the email alert. Because you chose Case as the object for the workflow rule, object appears as read only.
Choose an email template.
Select who receives email alerts from the workflow rule. To select all members of a case team, choose Case Team from Recipient Type, and add the team as selected recipients. You can enter up to five more email addresses.
Click Save.
Activate the workflow rule and its email alert.
From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules
From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
Click New Rule.
From Select object, choose Case and click Next.
Choose the evaluation criteria. To ensure that every case is evaluated for an email alert, we recommend that you set the evaluation criteria to Evaluate the rule when a record is: created, and every time it’s edited.
Choose criteria are met and select the criteria that a case must match to send email alerts. For example, if you want team members to receive an email alert each time a case’s status is set to New, set the criteria to Case: Status equals New.
Click Save & Next.
Add email alerts to your workflow rule’s criteria.
Click Add Workflow Action and choose New Email Alert.
Choose an email template.
Select who receives email alerts from the workflow rule. To select all members of a case team, choose Case Team from Recipient Type, and add the team as selected recipients. You can enter up to five more email addresses.
Click Save.
Activate the workflow rule and its email alert.
2.Email alert using Process builder
From setup enter process builder.
Click new. Enter a name and select process starts when 'a record changes'.
Select the Object for the entry criteria.
Add the criteria
Select an action from the 'Immediate Action' section. Select Email alert. If you dont have an email alert already created click 'create one' option.
Click save
Activate it
3.Reference Email template using Apex
A sample code is given below:-
trigger happyBirthday on Member__c (after insert)
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> ccAddresses = new List<String>();
ccAddresses.add('magualn.d@igate.com');
for(Member__c mem:trigger.new)
{
mail.setTemplateId('00XU0000000YOlG'); //Id of the Email Template
mail.setCcAddresses(ccAddresses);
mail.setTargetObjectId('005U0000000gpc1'); // Id of Contact or Lead or User
mail.setSaveAsActivity(false);
mail.setWhatId(mem.Id); //Optional field to ensure proper merging of objects in template
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
best practise is to choose (if possible) 1 automation tool per object, so everything is manage in 1 place to avoid processes starting from different angles when the same criterias are given in different places.
We can send email alert using workflows.
1.Email alert using Workflow
- From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
- Click New Rule.
- From Select object, choose Case and click Next.
- Choose the evaluation criteria. To ensure that every case is evaluated for an email alert, we recommend that you set the evaluation criteria to Evaluate the rule when a record is: created, and every time it’s edited.
- Choose criteria are met and select the criteria that a case must match to send email alerts. For example, if you want team members to receive an email alert each time a case’s status is set to New, set the criteria to Case: Status equals New.
- Click Save & Next.
- Add email alerts to your workflow rule’s criteria.
- Click Add Workflow Action and choose New Email Alert.
- Choose an email template.
- Select who receives email alerts from the workflow rule. To select all members of a case team, choose Case Team from Recipient Type, and add the team as selected recipients. You can enter up to five more email addresses.
- Click Save.
- Activate the workflow rule and its email alert.
2.Email alert using Process builder- From setup enter process builder.
- Click new. Enter a name and select process starts when 'a record changes'.
- Select the Object for the entry criteria.
- Add the criteria
- Select an action from the 'Immediate Action' section. Select Email alert. If you dont have an email alert already created click 'create one' option.
- Click save
- Activate it
3.Reference Email template using ApexA sample code is given below:-
4. Sending email alerts using approval process
Please refer the following link
http:// https://salesforce.stackexchange.com/questions/136363/approval-process-assignment-email-alert-not-sending/136451 (http:// https://salesforce.stackexchange.com/questions/136363/approval-process-assignment-email-alert-not-sending/136451)
5.Sending email alerts using Quick action
An example of sending Email Quick Action for Cases is given in the below link
https://help.salesforce.com/articleView?id=case_interaction_send_email_quick_action_create.htm&type=5
Thanks
best practise is to choose (if possible) 1 automation tool per object, so everything is manage in 1 place to avoid processes starting from different angles when the same criterias are given in different places.