Skip to content

Send a Document as an Attachment in Flow

Documents can be sent as email attachments from an Action element.

This action is typically used immediately after a successful Document Generation action to deliver a document to a Lead, Contact, or User.

To enable:

  • Drag and drop a flow “Action” onto the flow canvas
  • Select the “Document” category
  • Select the “Send Email With Attachment” action

This will appear if the image fails to load

There are several configurable options for sending an email with document attachment (see complete settings below). One input variable is required:

  1. Attachment ID - An ID reference to a file Attachment of Chatter File (ContentVersion)

Attachment ID

The Attachment ID is a 15 or 18-char ID to a Salesforce Attachment or Chatter File (ContentVersion). This document is attached to the sent email.

Optional Input Values

While these input values are optional, the document delivery action will apply validation rules that require some either/or inputs.

Either an Email Template Name (class template) must be provided OR the email body and subject must be defined.

Also, either the EmailToID or the Email To Name

InputValid ValuesDefault ValueDescription
CC Email AddressesCC email recipients. Comma separated valuesEmptyA list of recipients to be cc’d on email message.
Email BodyString(2048)EmptyEnter the email body. Can include variables for personalized content.
Email From AddressAny email addressEmptyThe reply to email address.
Email From NameText(255)EmptyThe email “From” name value.
Email Save As ActivityTrue or FalseFalseCreates an activity on parent record when enabled.
Email SubjectText(1024)EmptyThe email subject
Email Template NameThe API name for a classic email template.EmptyThen defined, the email template will override the email subject and body.
Email To IDA lead, contact, or user IDEmptyWhen used in conjuction with EmailTemplate Name, the Email To record is merged with the email template body. Example {!Contact.Name} is merged using the EmailToID
Email To AddressA valid emailEmptyThe email recipient.
Email To NameText(255)EmptyThe email recipient’s name.
Run AsynchronousTrue or FalseFalseDetermines if the action is executed in a @future method context. Because this action makes an API callout, any uncommitted DML may throw an exception. Set Run Asynchronous=True to avoid this type of error.

Output Values

The following outputs are returned from this action. It’s generally best practice to capture the Success and Message values in variables, particularly in screen flows, for use in providing the user feedback.

InputValuesDescription
SuccessTrue or FalseIndicates whether the document generation action was successful. If False then details of the error are available in the Message output value.
Messagenull or String valuePopulated with error message details when Success=False.
Run AsynchronousTrue or FalseReflects the input value setting.