# Template Settings: Complete Reference

## Page Settings

These settings control the physical dimensions and margins of your generated document.

#### Page Layout

**Purpose:** Set overall page orientation and dimensions

**Options:**

| Value     | Description                   | Dimensions             |
| --------- | ----------------------------- | ---------------------- |
| Portrait  | Standard vertical orientation | 8.5" × 11" (US Letter) |
| Landscape | Horizontal orientation        | 11" × 8.5" (US Letter) |
| Custom    | User-defined dimensions       | Any size               |

**Behavior:**

* Selecting Portrait or Landscape locks width and height fields
* Custom allows manual entry of dimensions
* Changing layout resets margins to defaults

***

#### Page Width

**Purpose:** Set the width of the page

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 8.5 inches (Portrait), 11 inches (Landscape)

**Range:**

* Minimum: 1 inch (or equivalent)
* Maximum: 200 inches (or equivalent)
* Practical maximum: 17 inches (tabloid size)

**Examples:**

```
US Letter: 8.5 inches
A4: 21 cm
Business Card: 3.5 inches
Envelope: 9.5 inches
```

**Notes:**

* Only editable when Page Layout is "Custom"
* Consider printer capabilities
* Very large pages may have performance impact

***

#### Page Height

**Purpose:** Set the height of the page

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 11 inches (Portrait), 8.5 inches (Landscape)

**Range:**

* Minimum: 1 inch (or equivalent)
* Maximum: 200 inches (or equivalent)
* Practical maximum: 14 inches (legal size)

**Examples:**

```
US Letter: 11 inches
A4: 29.7 cm
Business Card: 2 inches
Legal: 14 inches
```

**Notes:**

* Only editable when Page Layout is "Custom"
* Affects pagination and content flow
* Must accommodate margin settings

***

#### Top Margin

**Purpose:** Set space between top of page and content

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 1 inch

**Typical Range:** 0.25 to 3 inches

**Examples:**

```
Standard: 1 inch
Letterhead: 2 inches
Minimal: 0.5 inches
Legal: 1.25 inches
```

**Notes:**

* Increased for pre-printed letterhead
* Minimum often limited by printer (typically 0.25")
* Affects header placement
* Consider header height when setting

***

#### Bottom Margin

**Purpose:** Set space between bottom of page and content

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 1 inch

**Typical Range:** 0.25 to 2 inches

**Examples:**

```
Standard: 1 inch
Minimal: 0.5 inches
Footer space: 1.5 inches
```

**Notes:**

* Consider footer content when setting
* Affects pagination
* Minimum often limited by printer

***

#### Left Margin

**Purpose:** Set space between left edge and content

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 1 inch

**Typical Range:** 0.25 to 2 inches

**Examples:**

```
Standard: 1 inch
Binding edge: 1.5 inches
Minimal: 0.75 inches
```

**Notes:**

* Increase for binding/hole punches
* Affects text alignment and readability

***

#### Right Margin

**Purpose:** Set space between right edge and content

**Syntax:** Numeric value

**Units:** Inches, Centimeters, or Pixels (based on Unit setting)

**Default:** 1 inch

**Typical Range:** 0.25 to 1.5 inches

**Examples:**

```
Standard: 1 inch
Minimal: 0.75 inches
Symmetric: 1 inch (same as left)
```

**Notes:**

* Often matches left margin for balance
* Affects line length and readability

***

#### Unit

**Purpose:** Set measurement unit for all dimension fields

**Options:**

| Value       | Description          | Use Case                |
| ----------- | -------------------- | ----------------------- |
| inches      | Imperial measurement | US documents            |
| centimeters | Metric measurement   | International documents |
| pixels      | Screen measurement   | Digital-only documents  |

**Conversion:**

* 1 inch = 2.54 centimeters
* 1 inch = 96 pixels (at 96 DPI)

**Notes:**

* Changing units converts all existing values
* Pixels less common for print documents
* Use inches for US, cm for international

***

### Document Options - Attachment & File Name Options

#### Output File Format

**Purpose:** Define the naming pattern for generated documents

**Syntax:** Text string with optional merge fields

**Merge Field Syntax:** `{!Object.Field}` (single braces)

**Default:** `SD-####.pdf` (sequential numbering)

**Maximum Length:** 255 characters (recommended: under 80)

**Examples:**

```
Proposal for {!Opportunity.Account.Name}
Legal Contract - {!DocumentID}
{!DocumentName} for {!Opportunity.Account.Name}
```

**Supported Merge Fields:**

* Standard fields from base object
* Custom fields
* Lookup fields (up to 5 levels)
* User fields: `{!User.FirstName}`

**Restricted Characters:**

* `/` (forward slash)
* `\` (backslash)
* `:` (colon)
* `*` (asterisk)
* `?` (question mark)
* `"` (double quote)
* `<` (less than)
* `>` (greater than)
* `|` (pipe)

**Notes:**

* Always include .pdf extension
* Use hyphens or underscores instead of spaces
* Null merge fields result in blank spaces in filename
* Very long names may be truncated by file systems

***

### Document Options - Attachment & File Options

#### Create Salesforce Attachment and link to record

**Purpose:** Automatically create attachment in Notes & Attachments

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Attachment created with each document generation
* Attachment appears in Notes & Attachments related list
* Attachment named according to Output File Format setting
* Attached to base record (Opportunity, Account, etc.)

**Storage:** Counts toward Salesforce Attachment storage limit

**Use Cases:**

* Legacy systems requiring attachments
* Classic interface users
* Integration requirements
* Backup to Files

**Notes:**

* Can be used simultaneously with Files
* Not recommended for new implementations
* Consider storage limits

***

#### Create Salesforce File and link to record

**Purpose:** Automatically create file in Salesforce Files

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: File created with each document generation
* File appears in Files related list
* File named according to Output File Format setting
* Linked to base record
* Supports sharing and collaboration features

**Storage:** Counts toward Salesforce Files storage limit

**Use Cases:**

* Modern Salesforce implementations
* Lightning Experience
* Collaboration requirements
* Version control needs

**Notes:**

* Recommended over Attachments for new implementations
* Better sharing and collaboration features
* Supports versioning

***

#### Create Salesforce Attachment only when emailed

**Purpose:** Create attachment only if document is emailed

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Attachment created only when email is sent
* No attachment for download/view only
* Saves storage for documents that aren't emailed

**Use Cases:**

* Reduce storage usage
* Only keep emailed documents
* Audit trail of sent documents

**Notes:**

* Independent of "Create Salesforce Attachment" checkbox
* Does not apply to Files, only Attachments
* Useful for high-volume generation where not all are emailed

***

#### Delete related Salesforce Attachment/File upon S-Doc deletion

**Purpose:** Control whether attachments/files are deleted with S-Doc record

**Type:** Checkbox

**Default:** Checked

**Behavior:**

* When checked: Deleting S-Doc record also deletes related attachments/files
* When unchecked: Attachments/files preserved even if S-Doc deleted
* Applies to both Attachments and Files

**Use Cases:**

**Keep Checked (Default):**

* Maintain data hygiene
* Prevent orphaned files
* Synchronize record cleanup

**Uncheck When:**

* Audit requirements mandate file retention
* Attachments/files serve independent purpose
* S-Doc records are temporary but files are permanent

**Notes:**

* Cannot be changed after generation
* Consider compliance requirements
* Affects storage cleanup strategy

***

#### Allow Edit

**Purpose:** Enable Live Edit feature for generated documents

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: "Edit" button appears on generated documents
* Users can edit document in browser
* Opens WYSIWYG editor
* Changes saved to document

**Use Cases:**

* Documents needing minor adjustments
* Templates with flexible sections
* Quick edits without regeneration

**Not Recommended For:**

* Legal documents
* Compliance-critical documents
* Templates with complex formatting
* Documents with strict version control

**Notes:**

* Works best with simple layouts
* Complex tables may not edit cleanly
* Requires "S-Docs Edit Document" permission
* Consider combining with versioning options

***

#### Allow naming of new Salesforce Attachment with each edit

**Purpose:** Let users rename attachments created during edits

**Type:** Checkbox

**Default:** Unchecked

**Requires:** "Allow Edit" must be checked

**Behavior:**

* When checked: User prompted to name attachment after editing
* Applies only if "Create new Salesforce Attachment with each edit" is also checked

**Use Cases:**

* Users need descriptive version names
* Tracking different edit iterations
* Clear version identification

**Notes:**

* Only works with Attachments, not Files
* Only applies when creating new attachments with edits
* User can keep default or enter custom name

***

#### Create new Salesforce Attachment with each edit

**Purpose:** Create new attachment version with each edit

**Type:** Checkbox

**Default:** Unchecked

**Requires:** "Allow Edit" must be checked

**Behavior:**

* When checked: Each edit creates new attachment
* When unchecked: Edits overwrite existing document
* Preserves version history if checked

**Use Cases:**

**Create New (Checked):**

* Need version history
* Audit trail required
* Track edit progression

**Overwrite (Unchecked):**

* Working drafts
* Storage constraints
* Only final version matters

**Notes:**

* Increases storage usage
* Provides edit audit trail
* Users can access all versions

***

#### Show Content Version JSON field

**Purpose:** Enable setting custom Content Version field values

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Reveals "Content Version Field Assignment JSON" text field
* Accepts JSON mapping of field API names to values
* Sets custom fields on ContentVersion object

**Syntax:**

```
{
  "Checkbox__c": "true",
  "Date_Created__c": "{{!Opportunity.CloseDate}}",
  "Type_Picklist__c": "Quote",
  "Type_Text__c": "{{!Opportunity.Name}}",
  "Decimal_Value__c": "12.34",
  "Integer_Value__c": "1234"
}
```

**Field Types Supported:**

* Text: String values
* Number: Numeric values (no quotes)
* Date: ISO format or merge fields
* Checkbox: "true" or "false"
* Picklist: API name of value

**Use Cases:**

* Custom metadata on files
* Classification fields
* Integration requirements
* Custom file attributes

**Notes:**

* Only works with Salesforce Files, not Attachments
* Fields must exist on ContentVersion object
* Merge fields use double braces: `{{!Field}}`
* Invalid JSON causes errors

***

### Document Options - Mass Merge Options

**Note:** These options only appear if Mass Merge is enabled in your org.

#### Allow user to email single consolidated document

**Purpose:** Enable emailing combined document after mass merge

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Email option appears after mass merge completes
* User can email combined PDF
* Email settings from template apply

**Use Cases:**

* Send batch invoices to accounting
* Email combined reports to management
* Distribute consolidated statements

**Notes:**

* Large PDFs may exceed email size limits
* Test email delivery before large batches
* Email settings can be configured separately

***

#### Do not archive the single consolidated document

**Purpose:** Prevent saving combined document to Salesforce Documents

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Combined PDF not saved to Documents folder
* When unchecked: Combined document archived
* Individual documents still created per settings

**Use Cases:**

**Don't Archive (Checked):**

* Large batches consuming storage
* Temporary batch processing
* Only individual documents needed

**Archive (Unchecked - Default):**

* Keep combined file for records
* Regulatory requirements
* Combined file sent externally

**Notes:**

* Saves storage space if checked
* Individual documents unaffected
* Consider compliance requirements

***

#### Do not include a page break between each document

**Purpose:** Remove automatic page breaks between documents

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Documents flow continuously
* When unchecked: Each document starts new page

**Use Cases:**

* Receipt printing (continuous forms)
* Labels on continuous stock
* Shipping labels
* Tickets

**Not Recommended For:**

* Standard documents needing separation
* When users need to separate individual docs
* Professional reports

**Notes:**

* Overrides default page break behavior
* Test print before production use
* Consider printer capabilities

***

#### Include a page break after every N documents

**Purpose:** Insert page breaks at regular intervals

**Type:** Text field (numeric)

**Default:** Empty (uses default behavior)

**Syntax:** Integer value

**Examples:**

```
5 = Page break after every 5 documents
10 = Page break after every 10 documents
25 = Page break after every 25 documents
```

**Behavior:**

* Blank or 1: Page break after each document (default)
* N > 1: Page break after every N documents
* 0: Same as leaving blank

**Use Cases:**

* Printer can handle N pages at once
* Batch separation for processing
* Organizing into groups

**Notes:**

* Useful for large batch printing
* Consider printer tray capacity
* Test with actual printer

***

#### Immediately clear S-Doc jobs after combine all

**Purpose:** Delete S-Doc Job records after combining

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Jobs deleted after "Combine All" clicked
* When unchecked: Jobs remain until manually deleted

**What Are S-Doc Jobs:**

* Temporary records for each document in mass merge
* Track generation status
* Allow individual document access

**Use Cases:**

**Clear Jobs (Checked):**

* Keep org clean
* Reduce record clutter
* Large batches create many jobs

**Keep Jobs (Unchecked):**

* Troubleshoot failures
* Access individual documents later
* Audit requirements

**Notes:**

* Can accumulate quickly
* Consider storage
* Cannot undo after deletion

***

#### Immediately clear S-Doc jobs after emailing

**Purpose:** Delete S-Doc Job records after emailing consolidated document

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Jobs deleted after sending consolidated email
* When unchecked: Jobs remain

**Use Cases:**

* Same as "clear after combine"
* Additional trigger point for cleanup
* Email marks completion of process

**Notes:**

* Can be used with or without "clear after combine"
* Consider if users might need to re-email
* Clean up automation

***

#### Sort the documents in the consolidated document by this field

**Purpose:** Define sort order for documents in combined PDF

**Type:** Text field

**Syntax:** `fieldName sortDirection[, fieldName sortDirection, ...]`

**Sort Directions:**

* `asc` = Ascending (A-Z, 0-9, oldest-newest)
* `desc` = Descending (Z-A, 9-0, newest-oldest)

**Examples:**

```
Name asc
CloseDate desc
Amount desc
Name asc, CloseDate desc
Account.Name asc, CreatedDate desc
```

**Supported Fields:**

* Standard fields
* Custom fields
* Lookup fields (dot notation)

**Important:**

* Don't include base object name
* ✓ Correct: `Name asc`
* ✗ Incorrect: `Opportunity.Name asc`

**Notes:**

* Separate multiple fields with commas
* First field is primary sort
* Case-sensitive for field names
* Use Insert Field tool to verify API names

***

### Document Options - Other Options

#### Template contains international characters (Unicode fonts)

**Purpose:** Enable Unicode character support

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Enables Unicode character rendering
* Required for non-English characters
* Works with Unicode enforcement level setting

**When to Check:**

* Any non-English characters
* Accented characters (é, ñ, ü)
* Non-Latin scripts (Chinese, Arabic, Russian)
* Special symbols

**Notes:**

* Check this first for international content
* May need to increase enforcement level
* Works with standard fonts
* Minimal performance impact

***

#### Enable Rich Text in Runtime Prompts Tab

**Purpose:** Control rich text editor in Runtime Prompts

**Type:** Checkbox

**Default:** Checked

**Behavior:**

* When checked: Text prompts show rich text editor (formatting toolbar)
* When unchecked: Text prompts show plain text area
* Affects loading time of Runtime Prompts tab

**Use Cases:**

**Keep Checked (Default):**

* Users need formatted input
* Email body templates
* Styled content needed

**Uncheck When:**

* Only plain text needed
* Loading time is slow
* Simpler interface preferred

**Notes:**

* Only affects prompts created after changing
* Doesn't affect template body editor
* Performance consideration for slow connections

***

#### Show warning messages during document generation

**Purpose:** Control warning message display

**Type:** Checkbox

**Default:** Checked

**Behavior:**

* When checked: All warning messages shown
* When unchecked: Only critical errors shown
* Affects user experience during generation

**Warning Types:**

* Null merge fields
* Missing lookup data
* Field access issues
* Non-critical formatting issues

**Use Cases:**

**Show Warnings (Checked - Default):**

* Development and testing
* Troubleshooting issues
* User training
* Quality control

**Hide Warnings (Unchecked):**

* Production with known warnings
* User experience optimization
* Warnings are expected and acceptable

**Notes:**

* Critical errors always shown
* Consider user experience
* May hide useful information

***

#### Redirect back to record

**Purpose:** Return user to record after generation

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: User redirected to base record after generation
* When unchecked: User stays on S-Doc/generation page

**Use Cases:**

**Redirect (Checked):**

* Streamline workflow
* Users continue working on record
* Generation is one step in process

**Stay on Page (Unchecked):**

* Users need to email document
* Users need to edit document
* Multiple actions on generated doc

**Notes:**

* Affects user workflow
* Consider what users do next
* Can be overridden by user navigation

***

#### Attach related case articles to outbound email

**Purpose:** Include case articles in emails

**Type:** Checkbox

**Default:** Unchecked

**Requires:** Base object must be Case

**Behavior:**

* When checked: Articles from case automatically attached to email
* Articles added along with generated document
* Only applies when emailing document

**Use Cases:**

* Customer support responses
* Knowledge base distribution
* Case resolution documentation

**Notes:**

* Only works with Case object templates
* Only affects emailed documents
* Articles must be attached to case

***

#### Unicode enforcement level

**Purpose:** Set level of Unicode character handling

**Type:** Picklist

**Options:**

| Value        | Description                      | Performance     | Use When                     |
| ------------ | -------------------------------- | --------------- | ---------------------------- |
| (blank/None) | Standard handling                | Fast            | English only                 |
| Data         | Enforces Unicode in merge fields | Minimal impact  | Western European languages   |
| Strict       | Full Unicode enforcement         | Moderate impact | Asian/Arabic/Complex scripts |

**Behavior:**

* None: Default behavior
* Data: Unicode in data fields only
* Strict: Complete Unicode handling

**Use Cases:**

* None: English documents
* Data: French, German, Spanish, Portuguese
* Strict: Chinese, Japanese, Korean, Arabic, Hebrew, Thai

**Notes:**

* "Template contains international characters" must also be checked
* Increase level only if needed
* Higher levels = more processing
* Test with actual characters

***

#### Maximum versions retained in archive

**Purpose:** Limit number of template versions saved

**Type:** Text field (numeric)

**Default:** Varies by implementation (often 10-20)

**Syntax:** Integer value

**Examples:**

```
10 = Keep last 10 versions
25 = Keep last 25 versions
50 = Keep last 50 versions
0 or blank = Keep all versions (not recommended)
```

**Behavior:**

* New version created each time template is saved
* Oldest versions deleted when limit exceeded
* Version history accessible from template detail page

**Use Cases:**

**Lower Number (10-15):**

* Reduce storage
* Simple templates
* Infrequent changes

**Higher Number (25-50):**

* Complex templates
* Frequent iterations
* Detailed audit trail needed

**Notes:**

* Cannot recover deleted versions
* Consider development cycle
* Balance storage vs. history

***

#### List of merge fields that cannot be null

**Purpose:** Prevent generation if specified fields are null

**Type:** Text area

**Syntax:** One merge field per line

**Format:** `{{!Object.Field}}`

**Example:**

```
{{!Opportunity.Description}}
{{!Opportunity.Account.Name}}
{{!Opportunity.Amount}}
{{!Opportunity.CloseDate}}
```

**Behavior:**

* Document generation blocked if any listed field is null
* Error message shown to user
* User must populate fields before generating

**Use Cases:**

* Ensure required data present
* Prevent incomplete documents
* Data quality enforcement
* Compliance requirements

**Notes:**

* Use double braces: `{{!Field}}`
* One field per line
* No commas or semicolons
* Validation occurs before generation starts

***

### Email Settings - Email Subject Settings

#### Subject

**Purpose:** Set default email subject line

**Type:** Text field

**Merge Field Syntax:** `{!Object.Field}` (single braces)

**Maximum Length:** 255 characters

**Examples:**

```
Quote for {!Opportunity.Name}
Invoice {!Opportunity.InvoiceNumber__c} from Your Company
Proposal for {!Opportunity.Account.Name}
Contract: {!Opportunity.Name} - Action Required
```

**Supported Content:**

* Static text
* Merge fields from base object
* Combination of text and merge fields

**Notes:**

* Leave blank if users should always enter subject
* Can be locked to prevent user changes
* Null merge fields appear as blanks
* Consider mobile email clients (shorter is better)

***

#### Lock Subject

**Purpose:** Prevent users from changing email subject

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Subject field appears grayed out (not editable)
* When unchecked: Users can modify subject

**Special Behavior:**

* If locked AND blank: Subject field hidden entirely

**Use Cases:**

**Lock Subject (Checked):**

* Enforce branding standards
* Compliance requirements
* Prevent errors
* Consistent communication

**Allow Editing (Unchecked):**

* Users need flexibility
* Subject varies significantly
* Users add personal touches

**Notes:**

* Populate subject before locking (or field disappears)
* Test locked experience
* Consider user needs

***

#### Require subject line

**Purpose:** Force users to enter email subject

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Users cannot send email without subject
* When unchecked: Blank subject allowed
* Validation occurs when clicking Send

**Use Cases:**

**Require (Checked):**

* Ensure professional communication
* Email tracking and searching
* Best practices enforcement

**Optional (Unchecked):**

* Subject always pre-filled
* Subject field locked
* Rare edge cases need blank subjects

**Notes:**

* Doesn't apply if subject is locked with value
* Error shown if user tries to send without subject
* Independent of Lock Subject setting

***

### Email Settings - Email Recipient Settings

#### To

**Purpose:** Set default primary recipients

**Type:** Text area

**Merge Field Syntax:** `{!Object.Field}` (single braces)

**Format:**

* Single email: `user@example.com`
* Multiple emails: Comma-separated
* Merge fields: `{!Contact.Email}`
* Mixed: `user@example.com, {!Contact.Email}`

**Examples:**

```
{!Opportunity.Account.BillingEmail}
{!Contact.Email}
sales@company.com
{!Opportunity.Owner.Email}, manager@company.com
```

**Behavior:**

* Pre-populates To field
* Users can add/remove unless locked
* Null merge fields appear as blanks

**Notes:**

* Multiple recipients separated by commas
* Validate email addresses before locking
* Required if emailing capability needed

***

#### Lock To

**Purpose:** Prevent users from changing To recipients

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: To field grayed out (not editable)
* When unchecked: Users can modify recipients

**Special Behavior:**

* If locked AND blank: **Template cannot be emailed**
* Must have at least one recipient to send email

**Use Cases:**

**Lock (Checked):**

* Ensure correct recipients
* Compliance requirements
* Prevent misdirected emails
* Automated processes

**Allow Editing (Unchecked):**

* Recipients vary
* Users need flexibility
* Additional recipients needed

**Notes:**

* Must populate before locking
* Test locked experience
* Consider cc/bcc as alternatives

***

#### CC

**Purpose:** Set default CC (carbon copy) recipients

**Type:** Text area

**Format:** Same as To field

**Examples:**

```
{!Opportunity.Owner.Email}
{!User.Manager.Email}
accounting@company.com
sales@company.com, {!Opportunity.Owner.Manager.Email}
```

**Behavior:**

* Pre-populates CC field
* Users can add/remove unless locked
* Optional field

**Notes:**

* Separate multiple addresses with commas
* Can be left blank
* Locked + blank = field hidden

***

#### Lock CC

**Purpose:** Prevent users from changing CC recipients

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: CC field grayed out
* When unchecked: Users can modify

**Special Behavior:**

* If locked AND blank: CC field hidden

**Notes:**

* Often used to always copy management
* Field hidden if locked empty (intentional)
* Users cannot add CC if locked

***

#### BCC

**Purpose:** Set default BCC (blind carbon copy) recipients

**Type:** Text area

**Format:** Same as To field

**Examples:**

```
audit@company.com
{!User.Manager.Email}
archive@company.com
compliance@company.com
```

**Behavior:**

* Pre-populates BCC field
* Recipients hidden from other recipients
* Users can add/remove unless locked

**Use Cases:**

* Audit trails
* Manager oversight
* Compliance archiving
* Hidden copies

**Notes:**

* BCC recipients invisible to To/CC recipients
* Separate multiple with commas
* Locked + blank = field hidden

***

#### Lock BCC

**Purpose:** Prevent users from changing BCC recipients

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: BCC field grayed out
* When unchecked: Users can modify

**Special Behavior:**

* If locked AND blank: BCC field hidden

**Notes:**

* Useful for mandatory compliance copies
* Recipients remain hidden
* Consider privacy implications

***

#### Reply To

**Purpose:** Set email address where replies should go

**Type:** Text field

**Format:** Single email address or merge field

**Examples:**

```
support@company.com
{!User.Email}
{!Opportunity.Owner.Email}
noreply@company.com
sales@company.com
```

**Behavior:**

* Sets Reply-To header in email
* Can differ from From address
* Pre-populated, users can change unless locked

**Use Cases:**

* Replies to different address than sender
* Org-wide sender, personal reply-to
* Centralized response inbox
* Team email addresses

**Notes:**

* Only one Reply-To address allowed
* Can be merge field
* Useful with org-wide From addresses
* Locked + blank = field hidden

***

#### Lock Reply To

**Purpose:** Prevent users from changing Reply To address

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Reply To field grayed out
* When unchecked: Users can modify

**Special Behavior:**

* If locked AND blank: Reply To field hidden

**Notes:**

* Ensure replies go to correct address
* Test reply behavior
* Consider support workflows

***

### Email Settings - Email Sender Settings

#### From

**Purpose:** Set email sender address

**Type:** Picklist

**Options:**

* Logged in user
* Org-wide email addresses (if any configured)

**Behavior:**

* "Logged in user": Email from generating user's address
* Org-wide address: Email from selected company address

**Examples:**

```
Logged in user → john.smith@company.com
Sales Team <sales@company.com>
Support <support@company.com>
Billing <billing@company.com>
```

**Notes:**

* Org-wide addresses must be created and verified first
* User must have permission to use org-wide addresses
* Affects email deliverability and branding

***

#### Restrict to Org-Wide Addresses

**Purpose:** Force use of org-wide email addresses only

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Users cannot send from personal email
* When unchecked: Users can choose personal or org-wide

**Use Cases:**

**Restrict (Checked):**

* Professional branding
* Compliance requirements
* Centralized inboxes
* Better deliverability

**Allow Choice (Unchecked):**

* Personal communication
* Internal documents
* User flexibility needed

**Notes:**

* Requires at least one org-wide address
* User must have permission for org-wide addresses
* Affects From field options

***

#### Enable user to choose/select from a picklist

**Purpose:** Let users select from available sender addresses

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Dropdown of sender options shown
* When unchecked: Uses default From setting
* Dropdown includes personal and org-wide addresses (based on permissions)

**Dropdown Options:**

* User's personal email
* All org-wide addresses user has permission for

**Use Cases:**

* Multiple org-wide addresses available
* Users need flexibility
* Different senders for different scenarios

**Notes:**

* Requires org-wide addresses to be useful
* User permissions control available options
* Good for multi-department templates

***

#### Use Salesforce Email Signature

**Purpose:** Enable Salesforce email signature in templates

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: `{{{!UserSignature}}}` merge field becomes available
* Inserts generating user's Salesforce email signature
* Signature includes formatting from Salesforce settings

**Merge Field:** `{{{!UserSignature}}}` (triple braces)

**Use Cases:**

* Personal touch with professional sender
* User contact information
* Consistent signature formatting

**Notes:**

* User must have signature configured in Salesforce
* Use triple braces to preserve HTML formatting
* Place in template body or email body
* Signature controlled by user's Salesforce settings

***

### Email Settings - Other Email Settings

#### Email domain restriction

**Purpose:** Limit allowed email recipient domains

**Type:** Text field

**Syntax:** Comma-separated domain list

**Format:** `domain1.com,domain2.org,domain3.net`

**Examples:**

```
company.com
company.com,partner.com,client.org
company.com,company.co.uk,company.de
```

**Behavior:**

* Only addresses with listed domains allowed
* Applies to To, CC, and BCC fields
* Validation occurs when clicking Send
* Error shown if invalid domain detected

**Domain Syntax:**

* No spaces: ✓ `domain1.com,domain2.com`
* With spaces: ✗ `domain1.com, domain2.com`
* No @ symbol: ✓ `company.com`
* With @ symbol: ✗ `@company.com`
* No www: ✓ `company.com`
* With www: ✗ `www.company.com`

**Notes:**

* Case-insensitive matching
* Useful for security and compliance
* Test with invalid domain to verify
* Cannot be overridden at send time

***

#### Translate Email Settings Data

**Purpose:** Apply Data Map translations to email settings

**Type:** Checkbox

**Default:** Unchecked

**Requires:** Data Map translations configured

**Behavior:**

* When checked: Merge fields in email settings use translations
* Applies to Subject, To, CC, BCC, Reply To fields
* Uses Data Map for value translation

**Use Cases:**

* Multilingual email templates
* Translated field values
* International communications
* Localized content

**Notes:**

* Requires S-Docs Data Map feature
* Must define translations in Data Map
* Only affects merge fields, not static text
* Advanced feature

***

#### Lock Body

**Purpose:** Prevent users from editing email body

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Email body appears grayed out (not editable)
* When unchecked: Users can modify email message
* Body content defined in template

**Use Cases:**

**Lock (Checked):**

* Standard messaging required
* Compliance regulations
* Brand consistency
* Prevent errors

**Allow Editing (Unchecked):**

* Personal touches needed
* Messages vary significantly
* User discretion allowed

**Notes:**

* Email body defined in template editor
* Test locked experience with users
* Consider including signature field for personalization

***

### Create Salesforce Task Settings

**Note:** Create Salesforce Task tab only visible if feature is enabled in SDocsSettings Custom Settings.

#### Enable Salesforce Task Creation

**Purpose:** Turn on automatic task creation

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Task created with each document generation
* When unchecked: No tasks created
* Master switch for task creation feature

**Notes:**

* Requires "Enable Create Salesforce Task Feature" in SDocsSettings
* Tasks assigned to generating user
* Independent of other task settings

***

#### Allow user to toggle Salesforce Task creation

**Purpose:** Let users decide if task should be created

**Type:** Checkbox

**Default:** Unchecked

**Requires:** "Enable Salesforce Task Creation" must be checked

**Behavior:**

* When checked: Checkbox appears during generation
* Users can check/uncheck to create task
* When unchecked: Task always created (if enabled)

**Use Cases:**

**Allow Toggle (Checked):**

* Tasks not always needed
* User discretion appropriate
* Flexibility desired

**No Toggle (Unchecked):**

* Tasks always required
* Automated workflow
* Consistency needed

**Notes:**

* Adds step to generation process
* Checkbox defaults to checked
* User can opt out of task

***

#### Allow user to review/edit Salesforce Task details

**Purpose:** Let users modify task before creation

**Type:** Checkbox

**Default:** Unchecked

**Requires:** "Enable Salesforce Task Creation" must be checked

**Behavior:**

* When checked: Task details screen shown during generation
* Users can edit subject, status, due date
* When unchecked: Task created automatically with settings

**Editable Fields:**

* Task subject
* Task status
* Task due date

**Use Cases:**

**Allow Review (Checked):**

* Task details vary
* User input needed
* Flexibility important

**Auto-Create (Unchecked):**

* Consistent task details
* Streamlined process
* Minimal user input

**Notes:**

* Adds step to generation process
* Users can modify before creation
* Cannot change task assignment (always generating user)

***

### Create Salesforce Task - Subject, Status, Due Date

#### Salesforce Task Subject

**Purpose:** Set task subject line

**Type:** Text field

**Merge Field Syntax:** `{!Object.Field}` (single braces)

**Default:** "S-Doc Generated: Template\_Name" (if blank)

**Examples:**

```
Follow up on {!Opportunity.Name}
Quote sent - follow up needed
{!Opportunity.StageName} - Next steps for {!Opportunity.Account.Name}
Review contract for {!Opportunity.Name}
```

**Supported Content:**

* Static text
* Merge fields from base object
* Combination of text and merge fields

**Notes:**

* Leave blank to use default
* Merge fields use single braces
* Null merge fields appear as blanks
* Consider task list readability

***

#### Salesforce Task Status

**Purpose:** Set task status

**Type:** Text field

**Default:** "Completed" (if blank)

**Valid Values:** Any value from Task Status picklist in your org

**Standard Values:**

* `Not Started`
* `In Progress`
* `Completed`
* `Waiting on someone else`
* `Deferred`

**Examples:**

```
Not Started
In Progress
Completed
Waiting on someone else
```

**Behavior:**

* Must match org's picklist values exactly
* Case-sensitive
* "Completed" goes to Activity History
* Other statuses go to Open Activities

**Notes:**

* Verify picklist value exists in your org
* "Completed" = audit trail (activity history)
* "Not Started" = action item (open activities)
* Custom values allowed if in your org

***

#### Days until Salesforce Task is due

**Purpose:** Set task due date

**Type:** Text field (numeric)

**Syntax:** Integer value (number of days)

**Default:** 0 (blank = today's date)

**Examples:**

```
0 or blank = Today
1 = Tomorrow
7 = One week from today
30 = One month from today
```

**Behavior:**

* Calculated from document generation date
* Can be influenced by "Count business days only" setting
* 0 or blank = due today

**Notes:**

* Must be whole number
* Cannot be negative
* Use 0 or blank for immediate tasks
* Consider typical follow-up timeframes

***

#### Count business days only

**Purpose:** Exclude weekends from due date calculation

**Type:** Checkbox

**Default:** Unchecked

**Behavior:**

* When checked: Only weekdays counted
* When unchecked: All days counted
* Weekends excluded, holidays included

**Examples:**

| Generated | Days | Business Days | Due Date                         |
| --------- | ---- | ------------- | -------------------------------- |
| Monday    | 7    | No            | Next Monday                      |
| Friday    | 7    | No            | Next Friday                      |
| Friday    | 5    | Yes           | Following Friday (skips weekend) |
| Monday    | 3    | Yes           | Thursday                         |
| Wednesday | 5    | Yes           | Next Wednesday                   |

**Notes:**

* Only excludes weekends (Sat/Sun)
* Does NOT exclude holidays
* Consider organizational work week
* Test with various generation dates

***

### Runtime Prompts

**Note:** Runtime prompts are created in the Runtime Prompts tab, not configured as individual settings.

#### Prompt Components

Each runtime prompt has:

Prompt Label:

* User-facing text shown during generation
* Example: "Special Terms and Conditions"

Prompt Type:

* Text
* Date
* Checkbox
* Related List

Prompt Name:

* Internal identifier used in merge fields
* No spaces allowed
* Example: SpecialTerms
* Used as: `{{!SpecialTerms}}`

Default Value:

* Pre-filled value
* Optional
* Depends on prompt type

Required:

* Checkbox
* If checked, user must enter value
* If unchecked, value is optional

Help Text:

* Guidance shown to users
* Explains expected input
* Example: "Enter discount percentage (0-100)"

***

#### Prompt Types

Text:

* Free-form text entry
* Can be short or long
* Rich text available if enabled
* Use for: Notes, descriptions, custom text

Date:

* Date picker
* Format: YYYY-MM-DD
* Use for: Delivery dates, expiration dates, custom dates

Checkbox:

* True/false selection
* Default: true or false
* Use for: Options, flags, boolean choices

Related List:

* Selection from related records
* Advanced configuration
* Use for: Contact selection, record picking

***

#### Using Prompts in Templates

**Syntax:** `{{!PromptName}}`

**Examples:**

```
<p>Special Terms: {{!SpecialTerms}}</p>
<p>Delivery Date: {{!DeliveryDate format-date="MMMM dd, yyyy"}}</p>
<p>Discount: {{!DiscountPercent}}%</p>
```

**With Conditional Rendering:**

```
<!--RENDER='{{!RushOrder}}' == 'true'-->
<p style="color: red;">RUSH ORDER</p>
<!--ENDRENDER-->
```

**Notes:**

* Prompt Name must match exactly (case-sensitive)
* Can use template attributes with prompts
* Triple braces for rich text: `{{{!PromptName}}}`

***

### Advanced Options

#### Enable S-Sign

**Purpose:** Enable e-signature functionality

**Type:** Checkbox

**Default:** Unchecked (disabled if S-Sign not installed)

**Requires:** S-Sign package installed

**Behavior:**

* When checked: Opens S-Sign panel in template editor
* Allows adding signature tags to template
* Enables sending for e-signature

**Use Cases:**

* Contracts requiring signatures
* Agreements
* Approvals
* Legal documents

**Notes:**

* Requires S-Sign trial or full version
* Contact <sales@sdocs.com> for S-Sign information
* Additional configuration required
* Separate product from S-Docs

***

#### Preview ID

**Purpose:** Enable template preview with real data

**Type:** Text field

**Syntax:** 15 or 18-character Salesforce record ID

**Format:** `006Q000001AbCDEF` or `006Q000001AbCDEFGH`

**Behavior:**

* When populated: "Save & Preview" button appears
* Click button to generate preview in new tab
* Uses data from specified record

**Use Cases:**

* Template development
* Testing with real data
* Demonstrations
* Stakeholder reviews

**Examples:**

```
006Q000001AbCDE (Opportunity ID)
001Q000001XyZAB (Account ID)
003Q000001FgHiJ (Contact ID)
```

**Notes:**

* Must be valid Salesforce record ID
* Must match template's base object
* Preview uses current user's permissions
* Doesn't create attachments or tasks

***

#### Export Template

**Purpose:** Generate importable template data

**Type:** Button and text area

**Process:**

1. Click "Generate" button
2. JSON string appears in text box
3. Copy entire string
4. Save to file for import elsewhere

**Use Cases:**

* Move templates between orgs
* Sandbox to production migration
* Share templates with partners
* Backup templates

**Output Format:** JSON string containing:

* All template content
* All settings
* Runtime prompts
* Formatting

**Notes:**

* Copy entire string carefully
* Don't modify JSON manually
* Save with descriptive filename
* Include date in filename

***

#### Configure Contact Lookup

**Purpose:** Add additional objects to contact lookup

**Type:** Multi-select picklist

**Availability:** Only for Opportunity and Account templates

**Default Objects Queried:**

* Contacts related to base record

**Additional Options:**

* Other objects with contact records
* Configured per org

**Behavior:**

* Selected objects queried for contact records
* Results added to contact selection dropdown
* Occurs during generation when contact merge fields present

**Use Cases:**

* Pull contacts from related cases
* Include contacts from custom objects
* Expand contact selection pool

**Notes:**

* Only visible for Opportunity/Account templates
* Requires special contact merge fields in template
* Advanced feature

***

#### PDF Stitch Configuration

**Purpose:** Configure PDF stitching functionality

**Type:** Configuration section

**Status:** Legacy feature

**Behavior:**

* Allows attaching PDFs from Salesforce to generated document
* Requires customization outside S-Docs package
* May not be fully supported in all cases

**Notes:**

* Legacy functionality
* Requires custom development
* Contact S-Docs support for more information
* Not recommended for new implementations
* May have limitations

***

### Template Editor Buttons

#### Save

**Purpose:** Save template changes without closing editor

**Location:** Top of template editor

**Behavior:**

* Saves all content and settings
* Keeps editor open
* Creates new template version (if versioning enabled)
* User remains in edit mode

**Use Cases:**

* Save progress while continuing work
* Checkpoint before major changes
* Periodic saves during development

**Notes:**

* Always save before testing
* Creates version in history
* No confirmation message
* Changes preserved

***

#### Save & Close

**Purpose:** Save changes and return to template detail page

**Location:** Top of template editor

**Behavior:**

* Saves all content and settings
* Closes template editor
* Returns to template detail page
* Creates new version

**Use Cases:**

* Finished editing
* Want to test template
* Done with changes

**Notes:**

* Equivalent to Save + manual navigation
* Convenient for workflow
* Automatically closes editor

***

#### Cancel

**Purpose:** Discard changes and close editor

**Location:** Top of template editor

**Behavior:**

* Discards all changes since last save
* Returns to template detail page
* No new version created
* Changes lost

**Confirmation:** Usually prompts for confirmation

**Use Cases:**

* Discard unwanted changes
* Revert to last saved version
* Abandon current work

**Notes:**

* Cannot undo Cancel
* Reverts to last saved state
* Always confirm before clicking

***

#### Save & Preview

**Purpose:** Save and generate preview in new tab

**Location:** Top of template editor

**Visibility:** Only appears when Preview ID is populated

**Behavior:**

* Saves current changes
* Generates document with preview record data
* Opens preview in new tab
* Editor remains open

**Use Cases:**

* Quick testing during development
* See changes with real data
* Iterate rapidly
* Demo to stakeholders

**Notes:**

* Requires valid Preview ID
* Uses current user permissions
* Doesn't create attachments/tasks
* New tab for preview

***

This complete reference provides comprehensive documentation for all template settings available in S-Docs. Use this reference for detailed specifications, valid values, and technical requirements when configuring templates.


---

# 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/developer-hub/template-configuration-and-styling/template-settings-complete-reference.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.
