function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ram P 40Ram P 40 

How many ways we can send an Email alert in salesforce and how ??

Raj VakatiRaj Vakati
You can send email alert from salesforce by using
  1. workflow email alert 
  2. Process Builder 
  3. apex code by using single email messages or mass email messages 
  4. global action and quick actions ( send email ) 
  5. Other config likes send email to case team or other team members 
  6. Standard salesforce features like Approval Process , Escalation rules 
  7. Any System notification 
  8. Mass Email from the salesforce
 
PINKY REGHUPINKY REGHU
Hi,
      We can send  email alert using workflows.
  1. Create email templates for notifications.
  2. Set up workflow rules that specify which actions on a case send email alerts to team members.
  3. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
  4. Click New Rule.
  5. From Select object, choose Case and click Next.
  6. Enter a rule name.
  7. 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.
  8. 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.
  9. Click Save & Next.
  10. Add email alerts to your workflow rule’s criteria.
  11. Click Add Workflow Action and choose New Email Alert.
  12. 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.
  13. Choose an email template.
  14. 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.
  15. Click Save.
  16. Activate the workflow rule and its email alert.
  17. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules
  18. Click Activate next to the name of the rule.
Meenu MathewMeenu Mathew
Hi Ram,
1.Email alert using Workflow
  1.  From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Rules.
  2. Click New Rule.
  3. From Select object, choose Case and click Next.
  4. 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.
  5. 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.
  6. Click Save & Next.
  7. Add email alerts to your workflow rule’s criteria.
  8. Click Add Workflow Action and choose New Email Alert.
  9. Choose an email template.
  10. 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.
  11. Click Save.
  12. Activate the workflow rule and its email alert.
2.Email alert using Process builder
  1. From setup enter process builder.
  2. Click new. Enter a name and select process starts when 'a record changes'.
  3. Select the Object for the entry criteria.
  4. Add the criteria
  5. Select an action from the 'Immediate Action' section. Select Email alert. If you dont have an email alert already created click 'create one' option.
  6. Click save
  7. 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 });
    }
}

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
Monika SingourMonika Singour
Out of all these ways, which will be the best practice?
Sang__cSang__c
Hi @Monika,

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.