By default, we prepopulate the To: field with a contact or lead email address when you open the email action from the contact or lead record home pages. Extend this behavior to other objects and also predefine the To:, Cc:, or Bcc: fields.
Required Editions
| Available in: Essentials, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create and modify the Email quick action: | Customize Application |
| To edit a page layout: | Customize Application |
The admin must specify the To recipient, Cc recipient, or Bcc recipient to associate the email with the Salesforce record. The recipient must be a lead, contact, or person account. The predefined fields must be lookup fields.
- Click Setup. In the Quick Find field, enter Global Actions, then click Global Actions.
- Open the Send Email action you want to modify.
- In the Predefined Field Values section, click New.
-
For Field Name, select one of the following fields:
- To Recipients
- CC Recipients
- BCC Recipients
-
Use the formula editor to associate your selected field with a Salesforce record using the
JUNCTIONIDLIST function.
Note For values with only one ID, you don’t have to use the JUNCTIONIDLIST function.For example:
- To associate the To Recipients field with the account’s primary contact record,
enter:
JUNCTIONIDLIST(Account__c.Contact__c) OR Account__c.Contact__c
- To associate the BCC Recipients field with the account’s owner and the owner’s manager,
enter:
JUNCTIONIDLIST(Account.ContactId, Account.Owner:User.ManagerId)
- To associate the To Recipients field with the account’s primary contact record,
enter:
- Click Save.
Let’s review an example for defaulting the contact, lead, or person account into the Email Action. You have a custom object called Application with a lookup field to the contact. The API name for Application is Application__c and the API name for the contact field is Contact__c. Since we're getting data from the related record (the contact id), we need an entity-specific email action for Application.
- In Setup, go to the Object Manager tab and click the name of your custom object, Application.
- Choose Buttons, Links, and Actions and click the New Action button.
- Choose the Send Email action type, complete the other fields, and click Save.
- Choose Buttons, Links, and Actions and click the name of the action you created.
- Add a predefined field for To Recipient, with the formula value Application__c.Contact__c, and click Save.
- Add the new email action to the page layout.