> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-email-editor-in-flow-updated.md).

# Open the Email Editor in Screen Flow

Use this guide when you want a **Screen Flow** to open the **S-Docs Email Screen** component.

Use this pattern when users should review the email before sending it.

{% hint style="info" %}
Use [How To: Email Generation (Updated)](/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-email-generation-updated.md) when the Flow should send the email without a review screen.
{% endhint %}

#### Start here if you are newer to Flow

New to Flow? Start with [Getting Started: Automate Document Generation](/quick-start/document-generation/getting-started-automate-document-generation.md).

### Prerequisites

* A **Screen Flow**
* At least one **Screen** element
* Access to **S-Docs Email Screen** in **Flow Builder**
* A base record ID for merge context
* Any HTML email template IDs, file version IDs, SDoc IDs, or default values you plan to preload

{% hint style="warning" %}
Lock a field only after you populate it.

A locked blank field can be hidden or unusable.
{% endhint %}

### Step-by-step tutorial

#### Step 1: Create or open the Screen Flow

Open **Flow Builder**.

Create a **Screen Flow**, or open an existing one.

Use a **Screen Flow** because the email editor runs on a Flow screen.

{% hint style="info" %}
**Admin Tip:** If this Flow runs from a record page, create a **Text** variable named `recordId`. This name is case-sensitive. Then enable **Available for input**.
{% endhint %}

#### Step 2: Add the screen where users will review the email

Add a **Screen** element.

Place it where users should review and send the email.

#### Step 3: Add the S-Docs Email Screen component

Open the screen component list.

Search for **S-Docs Email Screen**.

Drag the component onto the screen.

#### Step 4: Set the required component property

Enter a unique value in **API Name**.

This is the required component field.

#### Step 5: Map the email context and default values

Map **Record Id** to the base record.

Set **Email Template** when you want reusable HTML email content.

Set direct values such as **Email Subject**, **Email Body**, **Email CC Address**, or **Modal Title** when the Flow should control those fields.

If both **Email Template** and a direct value are set, the direct value overrides the template for supported fields.

#### Step 6: Add attachments

Use **Content Version Ids to Attach** for existing **Salesforce Files**.

Pass the file `LatestPublishedVersionId` value.

Use **S-Doc Ids to Attach** for S-Docs generated earlier in the Flow.

Pass the **SDoc** IDs as a comma-delimited value.

#### Step 7: Lock fields when users should not edit them

Set the lock properties with Flow boolean values.

Common lock fields include:

* **Lock Email Body**
* **Lock CC Address**
* **Lock From Address**
* **Lock Email Subject**
* **Lock Email To Address**

Only lock a field after you confirm the value is already set.

#### Step 8: Save, activate, and test

Save the **Flow**.

Activate it.

Then test the screen and confirm it:

* opens the email editor
* shows the expected recipients, subject, and body
* includes the expected attachments
* enforces the expected field locks

When the user clicks **Next** or **Finish**, the email sends automatically.

No extra action element is required.

### Troubleshooting and common errors

<details>

<summary><strong>The expected attachment is missing</strong></summary>

* **Symptom:** The email editor opens, but the expected attachment is not listed.
* **Cause:** The mapped value is not a valid **ContentVersion** ID or **SDoc** ID.
* **Fix:** Use `LatestPublishedVersionId` for **Salesforce Files**. Pass valid comma-delimited **SDoc** IDs for generated S-Docs.

</details>

<details>

<summary><strong>The subject or CC value is not what you expected</strong></summary>

* **Symptom:** The loaded email shows a different subject or CC value than the template.
* **Cause:** A direct component property value overrides the email template value.
* **Fix:** Review both the **Email Template** mapping and any direct values mapped into **Email Subject** or **Email CC Address**.

</details>

<details>

<summary><strong>A locked field is blank or unusable</strong></summary>

* **Symptom:** A locked field is hidden, blank, or cannot be used.
* **Cause:** The field was locked before a value was populated.
* **Fix:** Populate the field first. Then enable the lock property.

</details>

<details>

<summary><strong>The email uses the wrong record context</strong></summary>

* **Symptom:** Merge fields or recipients resolve from the wrong record.
* **Cause:** The wrong value was mapped into **Record Id**.
* **Fix:** Map the base record ID that should drive the email content and merge context.

</details>

### Advanced configurations and reference

* Component reference: [Email Screen component reference](/developer-hub/document-workflows/flow-reference.md#email-editor-screen)
* Use **Email Template** for reusable HTML email content
* Use **Content Version Ids to Attach** with `LatestPublishedVersionId`
* Use **S-Doc Ids to Attach** with comma-delimited **SDoc** IDs
* Direct values can override template values for supported fields such as subject and CC


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-email-editor-in-flow-updated.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
