Send Email Flow Action

Nate Helterbrand
salesforce flow apex

The Send Email Flow Action expands on the native Send Email flow action provided by Salesforce to add more functionality that is available like attaching documents. The flow action gives you access to the Apex SingleEmailMessage methods

Installation

Install the latest version of the unmanaged package: latest release

If you don’t want to install the package, feel free to deploy the components themselves by clicking the button below. Take note that this will override any existing components that have the same name.

Deploy to Salesforce

Usage

In the flow, make sure to pay attention to the field types for the input fields of the Apex action. For Example, the “To Addresses” input takes a list of input addresses, instead of just one email address.

The flow action references each of the attributes of the Single Email Message Apex class, so for more descriptions on the field names, reference these pages

Field NameField Type
BCC AddressesString List
CC AddressesString List
Character SetString
Entity Attachment IDsId List
HTML BodyString
In Reply To EmailMessage IDId
Email Opt Out PolicyString
Plain Text BodyString
Organization-wide Email Address IDId
ReferencesId
SubjectString
Target Object IDId
Email Template IDId
To Addresses ListString List
Treat Bodies as Template?Boolean
Treat Target Object As Recipient?Boolean
What IDId
BCC Sender Receives CopyBoolean
Reply To AddressString
Save As Activity?Boolean
Sender Display NameString
Use SignatureBoolean

Adding the Apex Action to your flow

  • The Apex Action is called, “Send Email Flow Action”

Example Flow setup

Example Flow

Troubleshooting

  • Make sure you’re adding the values for the “String List” fields above to Collection variables in your flow

    • See the example above, where there’s an “Assignment” step to adding those values to a list

    Assignment Example

  • Some of the Email options require other fields to be conditionally required based on usage and whether you’re using Email Templates, Email Templates with merge fields, Saving as an Activity, etc. Setup a fault action to properly debug your use-case before deploying to a Production Environment.