For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate and Email Your Document

Generate a document from a Salesforce record page, review it, and send it by email with the S-Docs Lightning Web Components.

What You'll Learn

  • Generate a document from a Salesforce record page

  • Review the generated file in the document list

  • Open the email editor from the generated document

  • Check recipients, subject, and sender details before sending

  • Troubleshoot the most common end-user issues

What You'll Build

In this tutorial, you will use an Opportunity record to generate a quote and email it to a customer.

By the end, you will have:

  • One generated quote linked to the Opportunity

  • One reviewed PDF ready to send

  • One outbound email sent from the record page

  • One repeatable workflow your team can use every day

Estimated time: 10 minutes

Prerequisites

Before you start, make sure you have:

  • Access to an Opportunity record page with Generate Documents (S-Docs) and Documents (S-Docs)

  • At least one S-Docs template available in the generation list

  • One test Opportunity with customer data

  • Permission to generate documents and send email from Salesforce

  • Email Deliverability set to All Emails in Setup

  • An admin-configured email template if you expect default subject or recipient values

If the S-Docs components do not appear on the record page, ask your Salesforce admin to complete Add S-Docs Lightning Components to a Record Page.

1

Step 1: Open the record where you want to send the document

Start on the Salesforce record that holds the customer data.

For this example, use an Opportunity.

  1. Open Salesforce.

  2. Go to Opportunities.

  3. Open one test opportunity.

  4. Confirm the record has the customer and quote details you want to send.

You are now on the record page where the full generate-and-send workflow happens.

2

Step 2: Generate the document

Use the S-Docs generation panel at the top of the record page.

You may see it labeled Generate Documents (S-Docs) or a custom title such as Templates to Generate.

  1. Find the S-Docs generation panel.

  2. Select the template you want, such as a quote template.

  3. Click Generate.

  4. Wait for the success notification if Notify User is enabled.

This creates the document from the record data.

If your page is configured to open previews automatically, the generated document may open right away.

3

Step 3: Confirm the document appears in the document list

After generation, the file should appear in the S-Docs document list on the same page.

You may see it labeled Documents (S-Docs) or a custom title such as Generated Documents.

  1. Scroll to the S-Docs document list.

  2. Look for the new file you just generated.

  3. Confirm the file name matches the document you expected.

  4. Confirm the document is tied to the same Opportunity.

This confirms the document was created and linked to the record.

4

Step 4: Review the document before you send it

Check the file before you email it.

  1. Open the generated document from the list.

  2. Review key details such as customer name, amount, and date.

  3. Close the preview when you are done.

This helps you catch record-data issues before the customer sees the document.

5

Step 5: Open the email editor

Use the email action from the generated document.

Depending on your page setup, this can appear as an Email action on the document row or as an action after you select the document.

  1. Find the generated document in the list.

  2. Open the email action for that document.

  3. Wait for the email editor to load.

If your admin enabled automatic email open, the editor may appear right after generation instead.

6

Step 6: Review the email details and send

Check the message before you send it.

  1. Confirm the To address is correct.

  2. Confirm the Subject matches the document you are sending.

  3. Confirm the From address matches your team's process.

  4. Review the email body.

  5. Make edits if your org allows them.

  6. Click Send.

What you just did:

  • Used the generated document as the source for the outbound email

  • Confirmed recipient and sender details before sending

  • Completed the full workflow without leaving the record page

7

Step 7: Verify the result on the record

Do one quick check after sending.

  1. Return to the Opportunity record if the editor closed.

  2. Confirm the generated document still appears in the document list.

  3. Confirm the workflow completed without an error.

  4. If needed, check the record's Files related list.

You now have a complete record-page workflow for generating and emailing S-Docs output.

Common Issues and Solutions

I do not see any templates in the generation panel

Check these items:

  • The page includes Generate Documents (S-Docs)

  • Your admin added templates to the component setup

  • The template matches the same base object as the record

  • You have access to the template

If the panel is empty, ask your Salesforce admin to review Configure Document Generation.

The document generated, but I cannot find it

Check these items:

  • Refresh the record page

  • Confirm the page includes Documents (S-Docs)

  • Confirm the generation finished without an error

  • Check the record's Files related list

The email editor opens, but the recipient is blank

Check these items:

  • The source record contains the expected email address

  • Your admin configured email defaults on the template

  • You can type the address manually if your org allows it

If email defaults are expected but missing, ask your admin to review Configure Email Template Settings.

I cannot send the email

Check these items:

  • All required email fields are completed

  • Your Salesforce user can send email

  • The sender option configured by your admin is valid

  • Your org did not apply a sending restriction that blocks the address

The document content looks wrong

Check these items:

  • The source record has the correct data

  • You generated from the correct template

  • You opened the newest generated file

If the layout or default values are wrong, share the issue with the template owner or Salesforce admin.

What You've Learned

✅ Generated a document from a Salesforce record page ✅ Confirmed the file appeared in the S-Docs document list ✅ Opened the email editor from the generated document ✅ Reviewed recipient, subject, and sender details ✅ Sent the document without leaving the record page

Next Steps

Practice Exercise

Send one test quote from an Opportunity record.

  1. Open a test opportunity.

  2. Generate one quote document.

  3. Review the file.

  4. Email it to yourself.

  5. Confirm the email arrives with the expected subject and attachment.

Bonus challenges:

  • Generate a second template from the same record.

  • Send the document to a different test address.

  • Update the Opportunity, regenerate the file, and compare the result.

Last updated

Was this helpful?