# Templates

## Templates at a glance

A template is the company document or email content used in inquiry, offer, order, procurement,
inspection, and invoice work. Administrators use Templates to maintain those documents, the list
of available variables, and the email wording associated with a document type.

The list identifies each entry by its **Template** type, **Uploaded file name**, and **Uploaded on** date.
Use the row's available action to download a sample, download the company version, upload a company
document, download the variable list, or edit the matching email content.

| If you need to… | Go to |
|---|---|
| Identify the document or email content to maintain | [Find a template](#find-a-template) |
| Choose the task for a template row | [Choose the right template action](#choose-the-right-template-action) |
| Download a sample, company file, or variable list | [Download a template or the variable list](#download-a-template-or-the-variable-list) |
| Upload a company document | [Upload a company template](#upload-a-company-template) |
| Edit email content | [Edit a document template](#edit-a-document-template) |
| Upload the variable list | [Upload the list of variables](#upload-the-list-of-variables) |
| Understand an error or unavailable action | [When a template action fails](#when-a-template-action-fails) |
| Return to the configuration area | [Configuration dashboard](https://pams-doc-test-fresh.atloria.app/p/pams-doc-test-fresh-N9B4TwWn3Q/user/configuration-home) |

![The Templates list with its three identifying columns and task controls](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/5ad38ecb30081825a4c46301a88c3f4e.png)

## Before you start

Have the approved file or saved email wording ready before changing a template, because the action
changes the content available to those document workflows.

**Prerequisites**

- Have a subscription that includes Word Templates. When it does not, the list is replaced by
  the subscription surface.
- Have administrator access that permits the action. **Upload list of variables** is available to permitted
  developer accounts when the subscription includes Word Templates.
- For a company document, have one `.doc` or `.docx` file ready. The upload surface accepts one
  file.
- For the variable list, have one PDF ready.
- For email editing, have the wording ready for the rich-text `E-mail template content` area.
  The editor also provides available variables through `#`.

## Find a template

The Templates list is the starting point for matching a business document to the content you
need to maintain. Read the row's **Template** value first, then use **Uploaded file name** and
**Uploaded on** to distinguish the file currently associated with that type.

**Prerequisites**

- Know whether you are maintaining inquiry, offer, order, procurement, or invoice content.

**Steps**

1. Open Templates from the configuration area.
2. In the Templates list, read the **Template** column to find the required document or email type.
3. Read **Uploaded file name** to identify the associated company file.
4. Read **Uploaded on** to compare the upload date when more than one entry needs review.

   ![The Templates grid with Template, Uploaded file name, and Uploaded on](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/d74d536e63b645a9151c92808c39ebcc.png)

**Result:** The required row is identified by its template type, file name, and upload date.

Use this row's available action to continue with the required template task.

## Understand the Templates screen

The Templates screen combines a page-level variable-list action with a list of template rows.
Each row can expose email editing and document actions according to its type and data.
The available popups are the company-template upload surface, the variable-list upload surface,
and the **HTML Template Editor**.

When Word Templates is not included in the subscription, the subscription-upgrade surface replaces
the list. The page-level **Upload list of variables** action is shown only to permitted developer
accounts.

> **Important:** Use the approved company document or email wording. Template content is used by
> the document workflows that follow.

File actions open a popup, while email-template actions open the **HTML Template Editor**. The
company-document and variable-list popups use **Upload**; the editor uses **Save** and
**Cancel**.

![The HTML Template Editor opened from an inquiry email-template row](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/e8f0960b9287a7a3a70b4b97ab9bd0c5.png)

The editor surface includes the selected type, **HTML Template Editor**, and the instruction
`Type # to insert a variable`. Its toolbar provides these controls.

To edit email content, select **Offer E-mail Template**, **Order E-mail Template**,
**PO E-mail Template**, **Invoice E-mail Template**, **Inquiry E-mail Template**, or
**RFQ E-mail Template** in the matching row.

| Editing purpose | Controls |
|---|---|
| History and text emphasis | `OK`, `Undo`, `Redo`, `Bold`, `Italic`, `Underline` |
| Alignment and lists | `Align Left`, `Align Center`, `Align Right`, `Ordered List`, `Bullet List` |
| Text and colour format | `Header`, `Font Color`, `Background Color` |
| Tables | `Insert Table`, `Delete Table`, `Insert Row Above`, `Insert Row Below`, `Delete Row`, `Insert Column Left`, `Insert Column Right`, `Delete Column` |

![The HTML Template Editor toolbar controls](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/97b4615aa6635590c2c3f22d6897e3a9.png)

## Choose the right template action

Choose an action from the row that matches the document type and whether a company file exists.

| Your purpose | Select | Row condition |
|---|---|---|
| Edit inquiry email content | **Inquiry E-mail Template** | The row is an inquiry template |
| Edit offer email content | **Offer E-mail Template** | The row is a technical or commercial offer template |
| Edit order email content | **Order E-mail Template** | The row is an order-confirmation template |
| Edit purchase-inquiry email content | **RFQ E-mail Template** | The row is a purchase-inquiry template |
| Edit purchase-order email content | **PO E-mail Template** | The row is a purchase-order template |
| Edit invoice email content | **Invoice E-mail Template** | The row is a commission or sales-invoice template |
| Download the sample document | **Sample template** | The row is not an inquiry template |
| Download the company document | **Company template** | The row is not an inquiry template and is not a basic template |
| Provide or replace the company document | **Upload company template** | The row is not an inquiry template |
| Download the variable list | **List of variables** | The row is not an inquiry template |

The page-level **click here to download the list of variables.** action downloads the variable
list when the subscription is included. The row-level **List of variables** action is available
for non-inquiry rows.

After choosing an action, follow the matching procedure below.

## Maintain and use a template

Use the action that matches the row. A download requests a file, an upload opens a file popup,
and an email action opens the editor for the selected type.

**Prerequisites**

- Locate the row using [Find a template](#find-a-template).
- Confirm that the required action appears for that row.

**Steps**

1. Choose the matching option in the If you need to… table below.

   | If you need to… | Select | Continue with |
   |---|---|---|
   | Download a file | **Sample template**, **Company template**, or **List of variables** | [Download a template or the variable list](#download-a-template-or-the-variable-list) |
   | Upload a company document | **Upload company template** | [Upload a company template](#upload-a-company-template) |
   | Edit email content | The row's email action | [Edit a document template](#edit-a-document-template) |

**Result:** The selected download request, upload popup, or **HTML Template Editor** is open.

### Download a template or the variable list

Download a sample, the current company document, or the variable list from the Templates screen.

**Prerequisites**

- Have the relevant non-inquiry row in view, or have the page-level variable-list instruction in
  view.

**Steps**

1. Select the action that matches what you need to download.

   | If you need to download… | Select |
   |---|---|
   | The sample document | **Sample template** |
   | The company document from a non-basic row | **Company template** |
   | The variable list from a non-inquiry row | **List of variables** |
   | The page-level variable list | **click here to download the list of variables.** |

   ![The page-level variable-list download instruction](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/812e8487c305b131a1686b6f9cd41d0b.png)

**Result:** The selected sample, company document, or variable-list download request is made.

### Upload a company template

Provide or replace the company document for a non-inquiry template.

**Prerequisites**

- Have one approved `.doc` or `.docx` file ready.
- Have a non-inquiry template row selected.

**Steps**

1. Select **Upload company template** for the row.
2. In the **Upload company template** popup, select **Browse**.
3. Choose the company document file.
4. Select **Upload**.

**Result:** The company-template upload request is submitted from the **Upload company template**
popup.

### Edit a document template

Change the email content associated with a document type.

**Prerequisites**

- Have an email-template row with its email action available.
- Have the approved wording ready.

**Steps**

1. Select the row's email action, such as **Inquiry E-mail Template**, **Offer E-mail Template**,
   **Order E-mail Template**, **RFQ E-mail Template**, **PO E-mail Template**, or **Invoice
   E-mail Template**.
2. In **HTML Template Editor**, edit the `E-mail template content` rich-text area.
3. Type `#` in the editor to insert an available variable.
4. Select the action that matches how you want to finish.

   | If you want to… | Select |
   |---|---|
   | Keep the changes | **Save** |
   | Close without saving | **Cancel** |

**Result:** The selected email-template editor action is completed or cancelled from
**HTML Template Editor**.

### Upload the list of variables

Upload the company variable reference when it is provided as a PDF and the page-level action is
available.

**Prerequisites**

- Have one PDF containing the list of variables.
- Have an included Word Templates subscription.
- Use an account permitted to access **Upload list of variables**.

**Steps**

1. Select **Upload list of variables**.
2. In the **Upload list of variables** popup, select **Browse**.
3. Choose the variable-list PDF.
4. Select the action that matches how you want to finish.

   | If you want to… | Select |
   |---|---|
   | Submit the file | **Upload** |
   | Close without submitting | **Cancel** |

**Result:** The variable-list upload popup is open for completion or cancellation, and its file
action is **Upload**.

## When a template action fails

When Word Templates is excluded from the subscription, the Templates list is unavailable. The same result applies when a row does not meet the action's type condition, while processing can also return an error.

| What you see | What it means | What to do |
|---|---|---|
| The subscription-upgrade surface replaces the list | Word Templates is not included in the subscription | Return to the [Configuration dashboard](https://pams-doc-test-fresh.atloria.app/p/pams-doc-test-fresh-N9B4TwWn3Q/user/configuration-home) or use a subscription that includes Word Templates |
| **Upload list of variables** is unavailable | The action is restricted to permitted developer accounts and subscriptions that include Word Templates | Use an account permitted for the action and confirm the subscription includes Word Templates |
| A row has no company-template action | The row is an inquiry template or the action condition is not met | Use the email action for an inquiry row, or choose a non-inquiry row for company-document work |
| `An error occurred while processing your request` appears | The selected operation returned the shared processing error | Check the selected row and file, then retry the same supported action |

If a download, upload, variable-list action, or editor save fails, the page displays
`An error occurred while processing your request`.

When the action is complete, continue with the document workflow below.

## Continue with the document workflow

After maintaining a template, continue in the workflow that uses the same **Template** type.

| Template content | Continue with |
|---|---|
| Inquiry | Inquiries |
| Offer | Offers |
| Order | Orders |
| RFQ | Purchase job RFQs |
| PO | Purchase job orders |
| Invoice | Create invoice |

Select the workflow that matches the maintained template rather than a different document
category.
