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
OpportunityOne 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
Opportunityrecord page with Generate Documents (S-Docs) and Documents (S-Docs)At least one S-Docs template available in the generation list
One test
Opportunitywith customer dataPermission 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.
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.
Open Salesforce.
Go to Opportunities.
Open one test opportunity.
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.
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.
Find the S-Docs generation panel.
Select the template you want, such as a quote template.
Click Generate.
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.
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.
Note: You may need to refresh the page to ensure the document is visible in the Generated Documents component.
You may see it labeled Documents (S-Docs) or a custom title such as Generated Documents.
Scroll to the S-Docs document list.
Look for the new file you just generated.
Confirm the file name matches the document you expected.
Confirm the document is tied to the same
Opportunity.
This confirms the document was created and linked to the record.
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.
Find the generated document in the list.
Open the email action for that document.
Wait for the email editor to load.
If your admin enabled automatic email open, the editor may appear right after generation instead.
Step 6: Review the email details and send
Check the message before you send it.
Confirm the To address is correct.
Confirm the Subject matches the document you are sending.
Confirm the From address matches your team's process.
Review the email body.
Make edits if your org allows them.
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
Step 7: Verify the result on the record
Do one quick check after sending.
Return to the
Opportunityrecord if the editor closed.Confirm the generated document still appears in the document list.
Confirm the workflow completed without an error.
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
Use Configure Email Template Settings if your team wants email defaults.
Use Configure Template Settings: Document Generation if your team wants cleaner file names and save behavior.
Use Add S-Docs Lightning Components to a Record Page if your admin still needs to set up the page.
Practice Exercise
Send one test quote from an Opportunity record.
Open a test opportunity.
Generate one quote document.
Review the file.
Email it to yourself.
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?

