# Automate E-Signature Requests via Email

***

### **Prerequisite (**[**If you have already configured these skip to Step 5**](#step-5-configuring-the-send-email-invocable-action-for-s-sign)**)**

**Step 1: Generate the Document**

Our first step is generating the actual PDF that needs to be signed.

1. Add the Generate Document invocable action (found in the S-Docs action folder) to your Flow.
2. Configure the Inputs:
   * Base Record ID: Pass the ID of the record driving this process (e.g., your Opportunity or Quote ID from a Get Records step).
   * Template ID: The Salesforce ID of the specific S-Docs Template used to generate the PDF.

*Note: This action will output a "Generated S-Doc" record, which we will use heavily in the following steps.*

#### Step 2: The Assignment Variable (The "Collection")

You need to create an Assignment element to store the generated document before it can be emailed.

Why do we need a Text Collection variable? When sending S-Sign requests, S-Sign enabled documents are *not* sent as static physical file attachments. Instead, they are securely delivered as dynamic signature links generated by the SDK.

A Text Collection variable acts as the bridge that captures the output from the document generation and passes it properly to the final email action. Using this collection variable ensures the SDK knows to route this securely as a signature link, whereas standard, non-S-Sign PDFs would just be sent as normal attachments.

1. Add an Assignment element to your Flow.
2. Create a New Resource for the variable:
   * Resource Type: Variable
   * API Name: `Sign_Link` (or any descriptive name)
   * Data Type: Text
   * Allow multiple values (collection): Checked *(Do not miss this!)*
3. Under Set Variable Values:
   * Variable: `Sign_Link`
   * Operator: Add
   * Value: Select the Generated S-Doc output from your Step 1 Generate Document action.

#### Step 3: Prepare the Signature Envelope

Next associate your generated document with a new S-Sign envelope. This step takes your generated document and places it into a secure envelope that will be handy for managing later.

1. Add the Prepare Envelope invocable action to the Flow.
2. Configure the Input:
   * S-Doc ID: Map this to the *Generated S-Doc* output from Step 1.

#### Step 4: Seal the Signature Envelope

1. Add the Seal Envelope invocable action.
2. Configure the Input:
   * Envelope ID: Map this to the *Envelope ID* output from your Step 3 Prepare Envelope action.

Sealing the envelope secures the document to the envelope, ensuring that no further modifications can be made to the document or its signature tags. Most importantly, sealing the envelope is exactly what generates the final, secure signing link and guarantees that *only* your designated recipients can access the signing request.

#### Step 5: Configuring the "Send Email" Invocable Action for S-Sign

You’ve done the heavy lifting of automating the document generation and creating the envelope. Now, it’s time to actually get that signature request into your customer's inbox.

The S-Docs Send Email invocable action is the final piece in your automated Salesforce Flow. Let's break down exactly how to configure this action, what is required, and how you can use the optional settings to dynamically customize your delivery.

***

<figure><img src="/files/41lFljF40dXqejfKFnho" alt=""><figcaption></figcaption></figure>

#### Configuring the Required Components

When you add the Send Email action (found in the S-Docs folder) to your Flow, you'll be greeted by the configuration panel shown in your screenshot. Let's start with the non-negotiables.

* **Provide a Label:** (e.g., "Send Signature Request") to easily identify the action on your Flow canvas. The API Name acts as the unique system identifier and will automatically generate based on your label, replacing any spaces with underscores.
* **Base Record ID (Required):** This is the ID of the Salesforce record driving the process (e.g., the Opportunity, Contact, or Custom Object ID). Use a variable from earlier in your Flow, such as `{!recordId}`.
* **S-Docs Email Template Name or ID (Required):** This tells the system *how* the email should look. You must provide the Salesforce ID or exact name of the S-Docs HTML Email Template you wish to use. Crucial Note: This template *must* be configured as an "S-Sign Enabled" email template so it can properly render the secure signing link
* &#x20;**Enable the "Attachments" Field: I**f you are sending an S-Sign request, this field is absolutely required for your workflow to function correctly. Here, you must map the Text Collection Variable (e.g., `Sign_Link`) that you created in the earlier Assignment step.
* *Why?* The system uses this variable to recognize that it shouldn't just attach a static PDF to the email. Instead, it securely injects the encrypted S-Sign link that was generated when you sealed the envelope.

***

#### Optional Settings:

One of the best parts about using Flow to send your S-Sign requests is the ability to use Flow variables to dynamically override the default settings of your S-Docs Email Template. Toggle any of these to Included to configure them:

* **Recipient Email Address:** Need to send the document to someone other than the default contact on the record? You can pass a specific email address variable here to override the template's standard "To:" field.
* **CC & BCC Recipient Email Address:** Perfect for conditionally copying managers, legal teams, or a shared inbox based on Flow logic (e.g., "If Opportunity Amount > $50k, CC the VP of Sales").
* **Org-Wide Email Address:** By default, the email will come from the user running the Flow. If you want the email to originate from a generic alias like *<billing@yourcompany.com>* or *<support@yourcompany.com>*, provide the ID of that Org-Wide Email Address here.
* **Subject Line:** Want to dynamically inject today's date, a specific quote number, or an urgent flag into the subject line? Pass a text formula or variable here to completely override the template's default subject.

#### Advanced: System Mode Generation

At the bottom of the panel, you'll see a toggle for System Mode Generation (Experience Cloud), which defaults to `False`.

* What it does: If you are triggering this Flow from a Salesforce Experience Cloud (Community) portal, external users might not have the necessary object-level or field-level security permissions to generate the document or access the related records. Toggling this to True forces the action to run in System Context, bypassing user permissions and ensuring your community users can successfully trigger signature requests without hitting permission errors.

Once you have your required inputs mapped and your optional overrides set, click Done, save your Flow, and run a test! You now have a fully automated, dynamic, and native e-signature machine right inside your Salesforce org.

***

### Troubleshooting

When working with complex invocable actions, governor limits and exact configurations matter. If your Flow is failing or behaving unexpectedly, check these common pitfalls:

* Always Start a New Transaction: Flow limits can get tricky when generating documents, manipulating data, and making callouts in a single run. For *both* the Prepare Envelope and Seal Envelope actions, expand the Advanced Options menu at the bottom of the action panel and check "Always Start a New Transaction." This breaks the Flow execution into distinct, safe chunks and prevents timing issues and DML/governor limit errors.
* Verify "S-Sign Enabled" Email Templates: In Step 5, the Email Template ID you provide *must* correspond to an "S-Sign Enabled" template. If you use a standard Salesforce text template or one that hasn't been configured for S-Sign, the SDK cannot render the signing link properly in the recipient's inbox.
* Double Check Your Collection Mapping: Are your users receiving standard PDF attachments instead of the secure signing link? Double-check Step 2 and Step 5. Ensure that the `Sign_Link` collection variable actually has the "Allow multiple values" box checked, and that it is placed correctly in the *Attachments* input of the Send Email action.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/s-sign/automation-and-envelope-lifecycle/automate-e-signature-with-flow-builder/automate-e-signature-requests-via-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
