Send an Email Alert when a new e2a email is received on an existing record in Salesforce

Setup an Email Alert whenever a new e2a Email is received

When using e2a, users can send and receive emails from a record in Salesforce i.e. Lead. To ensure the SLAs are met, our customers require that every email from their customers is responded to within time without any delays. To make that happen, we need to ensure that anytime an email is received on an existing record in Salesforce, the owner is notified. This notification email could be sent to the record owner, any specific user or an external email address. If you want to setup such an alert system so that an email alert is sent whenever a new email is received, then please proceed as follows. The steps below explain the procedure for setting email alerts on 'Lead', but could be used for any other Object( Standard/Custom, i.e. Case), just replace 'Lead' with 'Case'.



Field Configuration


First, we need to create a new custom field in 'Lead', which will be used to indicate the arrival of a new e2a email on 'Lead record. (goto Setup | Lead | Fields)


  1. Select New in section Lead Custom Fields & Relationships
  2. Select datatype as Picklist (It can also be a checkbox) and click Next
  3. Select Checkbox and click Next
  4. Provide Field Label (New e2a email received) and select Unchecked for the Default Value
  5. Provide Description and click Next (Example Description: 'The field is set to 'Yes' when an e2a email arrives and creates a new record')
  6. Select appropriate profiles in Establish field-level security and click Next
  7. Select appropriate page layouts in Add to page layouts and click Next (There is no requirement for this field to be visible on any layout and can thus be kept hidden)


Field Assignment Rule Configuration


Secondly, we need to configure a Field Assignment Rule in the related 'e2a Email Rule' to populate the created checkbox (New e2a Email) on arrival of an e2a email. 

  1. Go to e2a Email Rules and select your email rule linked to Target Object Lead. Click Edit
  2. Click on the New button in the Field Assignment Rule section 
    1. Select 'Update Record' from the Trigger On  drop-down
    2. Select 'Always' from the Trigger Type  drop-down
    3. Enter a number ( greater than 0) in the Processing Order field
    4. Select 'Fixed Value Assignment' from the Assignment Type drop-down
    5. Select 'New e2a Email received' (checkbox created earlier) from the Select Field drop-down
    6. Mark the checkbox as checked in the Field Value field ( To populate the field New e2a email received whenever a new e2a email is received on an existing Lead) 
    7. Check the Overwrite non-blank values field
    8. Click on Save


Email Alert Configuration


Thirdly, we need to create an Email Alert that will be sent out to the record owner/email address whenever a new record is created. 


  1. Go to Setup | Create | Workflow & Approvals| Email Alerts and click New Email Alert
  2. Add Description, select Lead for the Object drop-down, and select Email Template (This template will be used for Email Alerts)
  3. Select User from Search in Recipient Type (To whom Email Alerts will be sent)
  4. Select User in Available Recipients and click on Add button to move it to Selected Recipients
    • You can enter up to five email addresses in Additional Emails to be notified
    • You can choose default From Email Address from the drop-down list. Click on Save button


Now, to send an Email alert, we need to setup a Flow in Salesforce

Flow Setup

To get started with setting up the Salesforce Flow needed, follow the instructions below: 


  1. Click on the gear icon on the top-right of your screen and select Setup

  2. Locate the quick find on the left side of your screen and type in Flows and Click on the first returned result under Process Automation.

  3. Locate and click on the New Flow button on the right of your screen

  4. Choose the Record-Triggered Flow type from the available options and click on the Create button. This will automatically load the Configure Start pop-up.

    1. In the Object lookup, select Lead

    2. Under the Configure Trigger section, for Trigger the Flow when: select A record is updated 

    3. Under the Set Entry Conditions section, for the Condition Requirements drop-down, choose All Conditions are Met (AND) 

      1. Click in the Field and select $Record > New e2a Email received 

      2. From the Operator drop-down select Equals 

      3. In the Value field, enter True and select {!$GlobalConstant.True}

    4. For the Optimize the Flow for: options, select Actions and Related Records 

    5. Click on Done 

  5. Click on the plus sign after the Start element 

  6. Search for the Send Email Alert element and choose it to use

    1. In the New Action pop-up, search for the earlier created email alert in the Action lookup and select it

    2. Enter a suitable Label and Description for the element

    3. Under the Set Input Values for the Selected Action section, click in the Record ID field and choose $Record > Record Id

    4. Click on Done

  7. Click on the plus sign after the Email Alert element

  8. Search and Choose the Update Records Element

    1. When the New Update Records pop-up appear, enter a Label (Update Lead Field) and a Description

    2. From the How to Find Records to Update and Set Their Values options, choose Specify conditions to identify records, and set fields individually

    3. Under the Update Records of This Object Type section, in the Object lookup choose Lead

    4.  Under the Filter Lead Records section, Set the Condition Requirements to Update Records to All Conditions Are Met (AND) 

      1. In the Field option, select Id (Lead ID)

      2. From the Operator drop-down choose Equals 

      3. For the Value select $Record > Lead Id

    5. Under the Set Field Values for the Lead Records section

      1. For the Field select New e2a email received

      2. For Value search False and choose {!$GlobalConstant.False}

  9. Save and Activate the Flow


Congratulations! You have successfully set up an email alert whenever a new e2a email is received on a Lead record in Salesforce. 


Please contact us at for any questions.

Was this information helpful?
Quick survey: How do you rate Email-to-anything?
★★★★ - GOOD
☆☆☆☆ - RUBBISH