Auto Email Attachments
The SharePoint Connector can automatically attach files stored in SharePoint to outgoing emails sent from Business Central. When you send a document by email (for example, a posted sales invoice), the connector retrieves files from the record's SharePoint folder and adds them as attachments — no manual action required.
Auto Email Attachments Overview
What are Auto Email Attachments?
Typical scenario: your customer contracts, terms and conditions, or product sheets live in the customer's SharePoint folder. When you email an invoice to that customer, the connector automatically attaches those files alongside the invoice PDF:
- Email a sales invoice → the customer's "Contract" files are attached automatically
- Email a purchase document → the vendor's relevant files are attached automatically
- Which files are attached is controlled by file categories
When Does It Trigger?
Auto email attachments apply when a document is sent by email through Business Central's standard document sending flow — for example, the Send or Send by Email actions on posted documents, or sending via a Document Sending Profile with an E-Mail option.
Emails composed manually (for example, a blank email from the Email editor) do not trigger auto email attachments.
How It Works
- You send a document by email from Business Central
- The connector looks up the Table Mapping for the record being sent
- If an Auto Email Categories Filter is configured on that mapping, the connector determines the record's SharePoint folder (using the normal folder mapping rules, including inherited mappings)
- If an Auto Email Sub Folder is specified, only that subfolder of the record's folder is searched
- All files whose Category matches the filter are downloaded from SharePoint and added to the outgoing email as attachments
The files are downloaded at send time, so the email always contains the current version of each file.
Configuration
Auto email attachments are configured per table on the Table Mapping Card:
- Open Table Mapping and select the table of the record being emailed (for example, Sales Invoice Header for posted sales invoices — not the Customer table)
- Expand the Auto Email Attachments section
- Fill in the fields:
| Field | Description | Example |
|---|---|---|
| Auto Email Categories Filter | Category filter for files to attach. Use the lookup to select from configured categories. Supports standard BC filter expressions. | Contract or Contract&#|;Quote |
| Auto Email Sub Folder | If the files to attach are located in a subfolder of the record's folder, specify it here. Leave blank to search the record's root folder. | Email Attachments |
Leaving Auto Email Categories Filter blank disables the feature for that table.
Example: Auto-Attach Contracts to Invoice Emails
Your customer contracts live in each customer's SharePoint folder, and you want them attached whenever you email a posted sales invoice. Configure the filter on the Sales Invoice Header mapping — the table of the record being emailed:
| Setting | Value |
|---|---|
| Table | 112 (Sales Invoice Header) |
| Auto Email Categories Filter | Contract |
| Auto Email Sub Folder | (blank — look in root folder) |
Because the Sales Invoice Header mapping is typically Inherited Dynamic from Customer, the posted invoice resolves to the customer's SharePoint folder — so all files categorized as "Contract" in that customer's folder are attached to the email automatically.
Filter Expressions
The categories filter is a standard Business Central filter, so multiple categories can be combined:
| Filter | Result |
|---|---|
Contract |
Attach files categorized as Contract |
Contract&#|;Quote |
Attach files categorized as Contract or Quote |
Terms* |
Attach files whose category starts with "Terms" |
Prerequisites
- The table must have an active table mapping configured (see SharePoint Table Mapping)
- The mapping must have a metadata column with Show In File List = Category — without it, files have no category to filter on (see Adding Metadata Columns)
- File categories must be set up for the table (see File Categories)
- The files to attach must be assigned to a category matching the filter
- A valid SharePoint connection must be active for the sending user
Troubleshooting
No Files Are Attached
| Check | Resolution |
|---|---|
| Categories filter configured? | Set Auto Email Categories Filter on the Table Mapping Card |
| Files categorized? | Assign the matching category to the files in the FactBox |
| Correct folder searched? | If Auto Email Sub Folder is set, files must be in that subfolder, not the root folder |
| Connection active? | Verify the SharePoint connection and re-authenticate if needed |
Wrong Files Are Attached
| Check | Resolution |
|---|---|
| Filter too broad? | Narrow the categories filter (for example, Contract instead of *) |
| Files miscategorized? | Review category assignments in the record's SharePoint folder |
| Inherited mapping? | Records with inherited mappings use the parent's folder — verify the parent record's files |
Email Sends Slowly
Each matching file is downloaded from SharePoint at send time. If many or large files match the filter, sending takes longer. Use a specific category and, if needed, a dedicated subfolder to keep the attachment set small.