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
Shobha JamesShobha James 

Is there any way to send an email to the email id associated with picklist value?(using work flow)

I want to send an email to the persons whoever is selected in the picklist .
Ex: if ABC is selected in the picklist field ,the mail should go to ABC...@....com.
    if XYZ  is selected in the picklist field ,the mail should go to XYZ...@....com, they are not the Users
How can i do that using workflow or Process Builder?
Raj VakatiRaj Vakati
You can able to do it with apex trigger but not with process builder. Refer the below link for  Available Recipient Types for Email Alerts

https://help.salesforce.com/articleView?id=customize_wfalerts_recipienttypes.htm&type=5


Please refer this below code . In this example, email__c is picklist with emails 
 
trigger Acc on Account (after insert) {
    if(Trigger.isAfter){
        if(Trigger.isInsert ){ 
            
            //  Account acc = Trigger.new[0];
            //list of emails
            List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
            for(Account acc : Trigger.new){ 
                Messaging.SingleEmailMessage mail = 
                    new Messaging.SingleEmailMessage();
                
                // Step 2: Set list of people who should get the email
                List<String> sendTo = new List<String>();
                sendTo.add(String.valueOf(acc.Email__c));
                mail.setToAddresses(sendTo);
                
                // Step 3: Set who the email is sent from
                mail.setReplyTo('sirdavid@bankofnigeria.com');
                mail.setSenderDisplayName('Official Bank of Nigeria');
                
                // (Optional) Set list of people who should be CC'ed
                List<String> ccTo = new List<String>();
                ccTo.add('business@bankofnigeria.com');
                mail.setCcAddresses(ccTo);
                
                // Step 4. Set email contents - you can use variables!
                mail.setSubject('URGENT BUSINESS PROPOSAL');
                String body = 'messgae ';
                mail.setHtmlBody(body);
                
                // Step 5. Add your email to the master list
                emails.add(mail);
            }
            Messaging.sendEmail(emails);
            
        }
        
    }
}