Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Create an Email as a Quick Action
These examples show you how to do this using standard actions and override actions.
Launch the QuickAction (Global) Send Email action from a custom component. Quick/Standard Actions can be called using page references and the navigation service API in any custom Aura component.
Define Navigation Services, pageReference Utils, and Action Button
Pass Attributes in pageReference to navService
Pass in the appropriate attributes in pageReference to navService.
Add Predefined Fields Info
Allow the user to pass action field data as part of the pageReference attributes with the fieldOverride payload.
This code is an example of what a pageReference request could look like:
Default Email Field Values
By default, Salesforce prepopulates the To field with a contact or lead email address when you open the email action from the contact or lead record home pages. Ensure that the fields you specify in the encodeDefaultFieldValues function aren’t Read-Only in the Send Email global action’s layout. If the HTML Body and Subject fields are Read-Only, the email draft doesn’t include pre-populated text for those fields.
These fields are supported:
- FromAddress
- ToAddress
- CCAddress
- BccAddress
- Subject
- HTMLBody
- RelatedToId
The FromAddress field is set to the logged in user's email address. The Subject and HTMLBody are not set by default.
Only fields that are available on the email quick action are supported. For example, AttachmentId and ContentDocumentIds aren't supported as they are not part of the email quick action layout.
For more information on the supported fields, see Object Reference for the Salesforce Platform: EmailMessage.