Loading
Salesforce now sends email only from verified domains. Read More
Help Agent Performance DegradationRead More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Send and Log Your Email Example

          Send and Log Your Email Example

          This example uses the Send Email action to send and log an email to a contact. Your sales reps might forget to email your customer when an opportunity's stage is updated, so you want to email the customer and log it automatically with a flow.

          Required Editions

          View supported editions.
          User Permissions Needed
          To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: Manage Flow
          To create or update an opportunity:
          • Read on Opportunity
          • Create on Opportunity
          Important
          Important To send email from Salesforce, the Send Email action in Salesforce Flow requires domain-level and user-level email verification. Email delivery fails if either the user's email address or the email-sending domain is unverified. See Requirements to Send Email from Salesforce.
          Note
          Note If you're following along in an existing flow, make sure the Send Email action version is set to 1.0.1.

          Create the flow that sends and logs an email to your customer when an opportunity's stage is updated.

          1. Open the Flows list view.
            • From Setup, in the Quick Find box, enter Flows, and then select Flows.
            • From the Automation app, select the Flows tab.
            • From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
          2. Create a record-triggered flow.
            • From the Automation app, click New | Triggered | Record-Triggered Flow.
            • From Setup, click New Flow | Triggered | Record-Triggered Flow.
          3. Configure the Start element.
            1. For Object, click Opportunity.
              Opportunity is selected because that's the type of record that triggers the flow.
            2. For Trigger the Flow When, select A record is updated.
            3. In the Set Entry Conditions section, for Field, click Stage. For Operator, click is Changed. For Value, click True.
              A record is updated is selected, and this entry condition is added, because we want the flow triggered each time a opportunity record's stage is updated.
            4. Use the default values for the other fields.
          4. Add and configure a Get Records element.
            This setup gets the contact that's related to the opportunity record and brings it into the flow.
            1. Click Add element plus icon, and select Get Records.
              The Get Records configuration panel opens.
            2. For Label, enter Get Opportunity Contact and use the default API name Get_Opportunity_Contact.
            3. For Object, search for and click Opportunity Contact Role.
            4. In the Filter Email Template Records section, for Field, click Opportunity ID. For Operator, click Equals. For Value, click Triggering Opportunity, and then click Opportunity ID.
            5. Use the default values for the other fields.
          5. After the Get Records element, add and configure an Action element. The action element is used to send and log the email.
            1. Click Add element plus icon, and select Action.
              A list of available actions opens.
            2. In the search bar, enter Send Email, and then click Send Email.
              For more information about the Send Email action, see Flow Core Action: Send Email.
            3. For Label, enter Send Opportunity Update Email and use the default API name, Send_Opportunity_Update_Email.
            4. Click Compose Email Content.
            5. For Subject, enter the text Opportunity Update Notification.
            6. For Body, enter the email body content as Dear Valued Customer, Your purchase is one step closer to your doorstep! If you have any questions or need further assistance, please do not hesitate to contact us. Best regards, Your Sales Team
            7. For the Recipient ID value, click Opportunity Contact Role from Get Opportunity Contact, click Contact ID.
              This step sets the email recipient to the contact related to the opportunity record that triggers the flow when it gets updated.
            8. For the Log Email on Send value, click True.
              This step allows Salesforce to log the email to the contact you specified for Recipient ID.
          6. Save and name the flow.
          7. To make sure that the flow works as expected, debug and test it by using different scenarios.
          8. To start sending emails, activate the flow.
            A flow with a configured Send Email action

          The flow sends an email to the contact of an opportunity record when the stage is updated and logs the email.

          Important
          Important After migrating flows, always review and reconfigure the Send Email action to reference the new record IDs in the target Salesforce org. This step is crucial to avoid broken references and ensure that email delivery functions correctly.
           
          Loading
          Salesforce Help | Article