search-icon

Add a unique look and feel to your documents by personalising your document and email templates. DEAR uses MS Word templates for documents and emails, therefore with some basic MS Word and Mail Merge skills, you can customise existing templates and create new templates. You can create multiple templates for each type of document (Purchase Order, Sale Invoice, Shipping Label, etc.).


See below for the full lists of available MailMerge tables and fields and Template editing for a video tutorial of the process. 


NOTE: DEAR have a dedicated support team for resolving template issues, don't hesitate to contact DEAR Support for help.


Table of Contents


Templates basics

[back to top]


Document and email templates are accessed from Settings → Document & Email Templates. You will see each section (Purchase, Sale, Inventory, POS, etc.) and the default templates for each document type (Purchase Order, Purchase Invoice, etc.) within that section.


NOTE: Each template can have both a document template and an email template. Document templates generate PDF documents; clicking Print during an operation will allow you to print or save the document. Clicking Email will open a blank email with the PDF document as an attachment. By default, only document templates are provided. Email templates, when uploaded, will display in the body of the email, and the email subject line also needs to be pre-set.

Only MS Word files are accepted as a template format. All MS Word formatting (font size, alignment, etc.) is carried over to the document/email body.


Template structure

[back to top]

All sections in a template must be contained within TableStart and TableEnd tags. This defines which table the mail merge fields data will be pulled from. 

  • Templates will start and end with the parent TableStart and TableEnd tags, e.g. «TableStart:Purchase» and «TableEnd:Purchase». Child TableStart and TableEnd tags can be placed within the parent tags. 
  • Tables that may have multiple lines generated in them, for example, tables with sale order lines, purchase order lines, or additional Charges, will have TableStart and TableEnd tags within the table itself. e.g. «TableStart:POLines» and «TableEnd:POLines». These are child tags that will be found within the parent tags. 
  • TableStart and TableEnd tags that end in Details (POLineDetails, InvoiceDetails etc.) are for matrix documents, e.g. Purchase Order Matrix, Invoice Matrix. 


If you need to customise standard templates, make sure that the opening tag for any table «TableStart:NAME» has the matching closing tag «TableEnd:NAME», or your template will not work. See Mail Merge Fields for document templates for the list of available tables and mail merge fields. Try to change the structure as little as possible to preserve the template functionality. 


Sample Structure:


«TableStart:Purchase»

«Company» 

Purchase Order: «PONumber»


#CodeProduct DescriptionSupplier CodeUnitQuantityPriceDiscountAmount
«TableStart:POLines»«ID»«ItemCode»«ItemDescription »«SupplierItemCode »«Unit »«Quantity »«Price »«Discount»%«Total»«TableEnd:POLines »

«TableEnd:Purchase»


The most important thing to remember when making changes to templates is to change the FIELD CODE, not the FIELD NAME


Right-click any <<field name>> and click Toggle Field Codes to show the field code (displayed as {MERGEFIELD field code}). 


Windows users can toggle all field codes by holding down ALT + F9.

Mac users can toggle all field codes by pressing OPTION + F9.


<<FIELD NAMES>>: Don't change these.



{FIELD CODES}: Change these.



Once you have made your changes to the field code, right-click and click Update Field for the changes to take effect. 


Downloading templates

[back to top]


Download document and email templates to customise them.  


Downloading an existing template:

  1. In Settings → Document & Email Templates, select the template you want to customise. 
  2. Select Download Template or Download E-mail
    • NOTE: By default, only document templates are provided, and the Download E-mail button will not be visible. See Add an email template for more information. A sample email template has been provided at the bottom of this article for you to download.


Uploading new templates

[back to top]


Each section has the option of adding a new template. We recommend starting with downloading an existing template and editing it rather than creating new templates from scratch. 


Adding a new template:

  1. Click New in the section of your choice to begin.
  2. Select a template type for the new template. You can have as many instances of a template type as you require. 
  3. Give a unique template name to your template. 
  4. Upload a document and/or email template
  5. Configure email recipients for the document. See Configure default email recipients below for more information. 
  6. Save your changes – your new template will now be available to be selected from the appropriate task screen and tab (e.g. Purchase task, invoice tab).


Configure default email recipients 

[back to top]


You can configure who receives a purchase/sale/inventory email by default. 


Configure default email recipients for a document:

  1. Select the document to configure email recipients for to open a pop-up window. 
  2. Under Configure email recipients, you will see several options. This specifies who this document will be sent to by default (you can always email the document to different recipients manually from the purchase/sale/inventory document screen).
  3. The following default email recipients are available:
    • All active users: Send email to all active users of your organisation. 
    • All company contacts: Send email to all of your organisation's Company Contacts
    • Mailing List: Send email to all contacts added to a Mailing List. Mailing Lists are available for users with the Automation module subscription. 
    • BCC addresses: Any other email addresses, separated by commas.
    • Send to the Supplier: Sends email to the supplier for the purchase order. By default, this is enabled (only available for purchase documents).
    • Send to the Customer (only available for sale documents): Sends email to the customer for the sale order. By default, this is enabled (only available for purchase documents). 
    • Send to Sale Rep: Sends email to the sales rep associated with the sale order (only available for sale documents). 
  4. Save your changes to finish. 


Configure email sender

[back to top]


You can configure the email sender, changing which email address appears in the From field. This is configured from General Settings → Organisation


You can either choose currently logged-in user which will use the email of the current user whose actions trigger sending the email, or the default company billing address set in Reference Books → Company Contacts


Both of these settings have a sent from the system option which will send the email from the selected email address, but will display to the receiver as the company name instead. This option can help stop emails from ending up in the Junk/Spam folder of your customers. 


Reset and delete templates

[back to top]


You can reset any template back to the default template for that type by clicking on the template, then clicking Reset. Non-default templates can be deleted from the same pop-up window with Delete


Display the correct font in a document template

[back to top]


The following fonts are supported automatically by DEAR templates:

  • Calibri
  • Cambria
  • Candara
  • Times New Roman
  • Arial
  • Tahoma
  • Book Antiqua
  • Bookman Old Style
  • Century
  • Courier New
  • Trebuchet MS
  • Verdana
  • ARIAL Black
  • Helvetica
  •  and ID Automation (for Barcodes)


If you are using any other font please see instructions below for embedding custom fonts in MS Word. 


NOTE: Unfortunately due to limitations in Aspose library (which is used to render data from DEAR to documents) it is not possible to achieve exact results for all custom fonts. In this case, the library will replace the font with the best matching font from the library even if a custom font is embedded. 


Embed a font in a document template:

  1. Edit your templates in MS Word and check the Embed fonts in the file box under the Save tab in Word Options.
  2. Upload the template back to DEAR from Settings → Document & Email Templates.
  3. Print a test page, it will print the best matching font in case it is different from the template font.


Step-by-Step Instructions

[back to top]


Open the template management page by going to Settings → Document & Email Templates. Here you will see a collection of document and email templates, fully customisable in MS Word. The templates are organised according to module. They are:

  1. Purchase
  2. Sale 
  3. Inventory (includes assembly, disassembly, and job costing)
  4. DEAR POS templates
  5. Production
  6. Financial (expense claims and receipts)
  7. CRM

You can easily add a new template by clicking the blank template which appears in each of the sections. You can also edit an existing template by selecting that template from the list.

When you select a template, you're given the option to download the Word template to be able to edit it on your computer as well as reset the template to the original.  You will then need to select the relevant template type which will determine where that template can be used as well as its position in the template dropdown when you try to generate a document.


You can give the template a unique name. For example, if you have variations of purchase orders or sale orders which go out to different suppliers and customers, you're able to name these templates respectively and can easily find them in the dropdown when trying to create a document.


You also have the option to browse for a previously saved document on your computer as well as browse for a previously saved template to be used as an email template.


Let's open an existing template in Microsoft Word - it will display the structure of the template including all tables as well as mail merge fields which will be populated when this document is generated.



You'll find that every template will begin with TableStart and end with a TableEnd mail merge field.  These mail merge fields determine the section of DEAR Inventory where information to populate this template will be sourced from.

You will need to make sure that you preserve the structure.  If the structure is not preserved, your template will not work.


You can find all the various mail merge fields that belong to that particular section within the following articles:


If you wanted to change or add any of the information for the supplier.  For example, if you wanted to add a supplier fax number to the purchase order, you will need to copy an existing field, paste it back in, right-click on the field to toggle field codes, which will essentially show the contents of the field.


You then need to return to the purchase KB page and in the purchase table, you will need to find the supplier fax.


You will need to copy the supplier fax field, return to the document, and then replace supplier email with supplier fax.


We can then right-click and update the field which would update the contents of the field and reflect them in the field name.


You have another option for displaying mail merge fields for Windows users.  You can press ALT and F9 together which will display all mail merge fields available in the document including any IF functions as well as tables within the IF functions. For Mac users, those buttons are OPTION and F9.


Let’s also take a look at how changes can be made within tables especially those hidden within IF functions.

By pressing ALT and F9 together, we can reveal all the mail merge fields.  To make a change within the table, for example, if we want to get rid of a particular column, we'll need to select that column and then delete it.


To reflect that change in the mail merge field, we'll press ALT+F9 again, right-click on the field and update it. That will get rid of the particular column we deleted within the IF function.



Take care when deleting columns or making any changes in the tables.  Make sure that you press ALT+F9 if you're making any changes.  For example, if you were to make a change to this table without exposing the IF function that change will not take place.


For example, if I delete this Price column, if I was to update the field, the Price column will come back.  This is due to the fact that the mail merge field simply displays the table.  It doesn’t actually allow you to make any changes to the table without exposing the IF function first.  If I delete the Price column out of the table within the IF function, when I press ALT+F9 to hide the mail merge fields then update the field that will get rid of the Price column for me.


The same works in reverse when adding columns.  You will need to press ALT+F9 to reveal the table and insert a column.  For example, if I wanted to populate Additional Attribute 1, I then need to copy the existing field, paste it in then paste the field.  I will need to find the PO Lines table which will be used to populate the information in this table.


We need to return to purchase mailmerge article, find the PO Lines table and then copy AdditionalAttribute1, return to the template and then replace Unit with Description, press ALT+F9 to hide the field, and then update it.  This table will now be included in the extra column which will be used to complete the item’s description.


Examples

[back to top]


Now we will take a look at how to make some common template changes. 


Add a field

[back to top]


In this example, we will show how to add a field to an existing document template – adding a Supplier Fax field to a Purchase Order. 


Adding a field to a template:

  1. Download and open the template you want to make changes to – in this case, the Purchase Order template. 
  2. Copy an existing field to the location you want your new field to be. 
  3. Show the field code either by right-clicking the field and selecting Toggle Field Code or using Alt + F9 for Windows, Option + F9 for Mac.
  4. You then need to return to the purchase KB page and in the purchase table, you will need to find the supplier fax.
  5. Paste the SupplierFax field code into the field you want to change.
  6. Finally, right-click the field and select Update Field to finish.
  7. Check that your TableStart tags all have matching TableEnd tags, then save your edited template.
  8. On the 'Manage Document & Email Templates' screen, select 'Purchase Order' and upload your edited template. 


Delete a table column

[back to top]


Let’s also take a look at how changes can be made within tables. By pressing ALT + F9/Option + F9 together, all the mail merge fields are revealed, including those hidden within IF functions. 


Deleting a table column:

  1. Download and open the template you want to make changes to – in this case, the Purchase Order template. 
  2. Show all the field codes using Alt + F9 for Windows or Option + F9 for Mac.
  3. Highlight the table column to be deleted while the field codes are shown, right-click and select Delete columns.
  4. Toggle the view back to field names by clicking ALT + F9/Option + F9. 
  5. Right-click on the field name of the column that you have just deleted, then click Update Field. This will update the view to reflect the deleted column.
  6. Check that your TableStart tags all have matching TableEnd tags, then save your edited template.
  7. On the 'Manage Document & Email Templates' screen, upload your edited template.


Take care when deleting columns or making any changes in the tables. Make sure that you press ALT + F9/Option + F9 if you're making any changes, changing column widths, etc. For example, if you were to make a change to this table without exposing the IF function, that change will not take place – as soon as the field is updated, the changes will disappear.


Add a table column

[back to top]


The same works in reverse when adding columns. You will need to press ALT + F9/Option + F9 to reveal the table and insert a column. In this example, we will add a column for the product brand to the purchase order lines table. 


Adding a table column:

  1. Download and open the template you want to make changes to – in this case, the Purchase Order template. 
  2. Show all the field codes using Alt + F9 for Windows, Option + F9 for Mac.
  3. Highlight the table column where you want your new column, right-click and select Insert Columns.
  4. Copy an existing field into the empty new column.
  5. The TableStart/TableEnd tags show us that this is a POLines table – we can go to the POLines table in POLines table in Mail Merge purchase KB to find the product brand code. 
  6. Copy the field code (Brand) into the table column and give your new column a title.
  7. Press Alt + F9/Option + F9 to hide the field codes. 
  8. Right-click the table and select Update Field to show your changes.

Take care when adding columns or making any changes in the tables. Make sure that you press ALT + F9/Option + F9 if you're making any changes, changing column widths, etc. For example, if you were to make a change to this table without exposing the IF function, that change will not take place – as soon as the field is updated, the changes will disappear.


Add an email template

[back to top]


By default, none of the documents provided by DEAR have an email template. When emailing a document, by default, the body and subject are left blank. 


In this example, we will add an email subject line and simple email body template with a company signature for the purchase order. 


Adding an email template:

  1. We will start by downloading and opening the default purchase order template from Settings → Document & Email Templates
  2. Using the existing template, we can delete the parts we do not want to use (e.g. footer content, tables). We can also add parts by copying and pasting the required fields, as well as adding new ones if necessary (in this example, <<MyName>> field has been added using the steps shown in Add a field). Remember to make all changes when field codes are toggled on, using Alt + F9/Option + F9. 
  3. Right-click any changed fields and select Update Field to show your changes.
  4. Check that any TableStart tag has a matching TableEnd tag, then save your template.
  5. On the 'Manage Document & Email Templates' screen, select the purchase order template you selected in Step 1.
  6. Add an email subject line – when you click the Email Subject field, a menu appears with clickable options which can be inserted into the email subject line.
  7. Browse to the location of the email template you created earlier and select it.
  8. You can choose who document emails are sent to by default. See Configure default email recipients for more information. 
  9. Save your changes.


Now when emailing a purchase order to a supplier, your new email template will be applied:


[back to top]


To insert your company logo into the template, you can use the Word Insert Pictures function or simply copy-paste the image into the template.  

Once you've inserted the image, you may have to change the text wrapping for the image. Generally, the In Front of Text option allows you to position the image anywhere you like. 



Add a credit note memo to a credit note purchase

[back to top]


It is not currently possible to display credit order notes on documents for the supplier when the credit note is applied to a simple or advanced purchase order. We recommend using the purchase order memo field to make notes that need to be shown on supplier documents. For standalone credit notes/credit note purchases, Credit Memo field text can be added to a Purchase Return document template. The Credit Note memo info is held within the PurchaseOrderMemo field. 


This process is identical for adding a credit note memo to a credit note sale. 


Adding a credit note memo to a credit note purchase:

  1. In Settings → Document & Email templates, download the Purchase Return template.
  2. Add a PurchaseOrderMemo field code where you would like your credit note to be displayed using the Add a field method shown above. Make sure the field code is before the TableEnd:Purchase tag. 
  3. Toggle field codes off, right-click the PurchaseOrderMemo field and select Update Field
  4. Save the edited template and upload.
  5. Printing the Purchase Return (Credit note purchase) will now display the credit note memo.

[back to top]


There are two ways to insert Pay Link into a document template: with a standard Pay Link image and with a custom Pay Link image. DEAR supports pay links from Stripe and PayPal. Documents can contain both types of pay links.


Once a customer clicks on the PayLink, they will be taken through the payment process. 


NOTE: PayPal and/or Stripe must be connected and configured for pay links to display. Simple text hyperlinks are not supported.


Insert a Standard Pay Link image:

  1. In Settings → Document & Email templates, download the Quote and/or Invoice template.
  2. Copy an existing field to the location you want your pay link to be. 
  3. Show the field code either by right-clicking the field and selecting Toggle Field Code or using Alt + F9 for Windows, Option + F9 for Mac.
  4. Replace the copied field with the mail merge field { MERGEFIELD PayPalPay} and the field will be replaced by the PayPal PayLink image. Use the mail merge field { MERGEFIELD StripePay} and the field will be replaced by the Stripe PayLink image.
  5. Toggle field codes off.
  6. Save the edited template and upload.



To insert a Custom Pay Link image:

  1. As above – replace the copied field with the code { IF “{MERGEFIELD PayPalPayLink}”=”” “<CustomImage>” “<CustomImage>” } OR { IF “{MERGEFIELD StripePayLink }”=”” “<CustomImage>” “<CustomImage>” } and this field will be replaced by PayLink with the specified <CustomImage> inserted into the Word Template. 
  2. Save the edited template and upload. 



Add customer tax number to DEAR POS receipt

[back to top]


Some countries require the customer tax number to be printed on a customer’s receipt, for example in order to claim VAT. Users can now enter and edit a customer’s tax number from the DEAR POS application. Users can also add Customer Tax Number to the POS Receipt template. 

  1. In Settings → Document & Email templates → POS, download the Receipt template.
  2. Scroll down until you see <<TableStart:Customer>> - this is the correct parent table.
  3. Copy an existing field such as Customer: <<CustomerName>> to the location you want your new field to be. 
  4. Show the field code either by right-clicking the field and selecting Toggle Field Code or using Alt + F9 for Windows, Option + F9 for Mac.
  5. Replace the CustomerName field with TaxNumber field (Field codes are available in MailMerge fields for DEAR POS templates).
  6. Right-click the changed field and select Update Field to show your changes.
  7. You can see the TaxNumber field has been added successfully.
  8. Save the edited template and upload. 


Change barcode format for DEAR POS product labels

[back to top]


DEAR POS allows printing of product labels as long as these products have barcodes defined for them in DEAR Inventory. The type of barcode to be used is controlled by mail merge field name in the POS product label template. By default, the template uses EAN-13 but you can add or swap the barcode field of the template to display the barcode in another format.  

  1. In Settings → Document & Email templates → POS, download the Price Label template.
  2. Make sure you are working within <<TableStart:ProductLabels>> - this is the correct parent table.
  3. Select the field «ProductBarCode_ean13» and show the field code either by right-clicking the field and selecting Toggle Field Code or using Alt + F9 for Windows, Option + F9 for Mac.
  4. Replace the ProductBarCode_ean13 field with another barcode field (Field codes are available in MailMerge fields for DEAR POS templates). Available barcode formats are:
    • ProductBarCode_code93,
    • ProductBarCode_code128,
    • ProductBarCode_ean8,
    • ProductBarCode_ean13,
    • ProductBarCode_industrial2of5,
    • ProductBarCode_upca,
    • ProductBarCode_upce
  5. Right-click the changed field and select Update Field to show your changes.
  6. Save the edited template and upload. 



Change barcode format for DEAR POS product receipts

[back to top]


DEAR POS allows printing of product labels as long as these products have barcodes defined for them in DEAR Inventory. The type of barcode to be used is controlled by mail merge field name in the POS product label template. By default, the template uses EAN-13 but you can add or swap the barcode field of the template to display the barcode in another format.  

  1. In Settings → Document & Email templates → POS, download the Receipts template.
  2. Scroll to the end of the document - this is not contained within a parent table. 
  3. Select the field «ReceiptBarCode_ean13» and show the field code either by right-clicking the field and selecting Toggle Field Code or using Alt + F9 for Windows, Option + F9 for Mac.
  4. Replace the ReceiptBarCode_ean13 field with another barcode field (Field codes are available in MailMerge fields for DEAR POS templates). Available barcode formats are:
    • ReceiptBarCode_code93,
    • ReceiptBarCode_code128,
    • ReceiptBarCode_ean8,
    • ReceiptBarCode_ean13,
    • ReceiptBarCode_industrial2of5,
    • ReceiptBarCode_upca,
    • ProductBarCode_upce
  5. Right-click the changed field and select Update Field to show your changes.
  6. Save the edited template and upload. 


Troubleshooting

[back to top]


Why is DEAR putting the invoice in the body of the email?

This is because you have uploaded an invoice template as an email template for the document. To have a clear email body, please create an empty MS Word document and upload it as an email body for the document in Documents & Templates.


I modified the Sale Quote template and it doesn't work now. How do I get the default version?

  1. Go to Settings -> Document and Email Templates
  2. Find the template you wish to reset.
  3. Open the template (in this case, the Sales Quote template).
  4. Click Reset to return to the default template.


I use Myriad Po as the font for my custom invoices and packing list in my Mail merge templates. However, when I generated my custom invoices and packing list, my header is displayed in another font instead.

This means that the font is not available and user needs to embed it on the document. To embed the font in the document, edit the template in MS Word, enable Embed fonts in Word Options, then save and upload the template to DEAR and test. If you need our assistance in this matter, you may forward your template in MS Word format to DEAR Support.


How can I change the number of decimal places in mailmerge field code?

Decimal points of output value of a field can be adjusted by adding field code switch \# i.e.  changing {MERGEFIELD Price1} to {MERGEFIELD Price1 \#,##0.00} for two decimal places in output value for price1, {MERGEFIELD Price1 \#,##0.000} for three decimal places in output value for price1 and {MERGEFIELD Price1 \#,##0} for no decimal places in output value for price1


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.