Manage Document and Email Templates

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 Mail Merge Fields for document templates for a full list of available types 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) 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. Tables that may have multiple lines generated in them, for example, Purchase Order Line, Sale Order Line or Additional Charges, will have TableStart and TableEnd tags within the table itself. 


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»

«TableEnd:Purchase»


#

Code

Product Description

Supplier Code

Unit

Quantity

Price

Discount

Amount

«TableStart:POLines»«ID»

«ItemCode»

«ItemDescription »

«SupplierItemCode »

«Unit »

«Quantity »

«Price »

«Discount»

%

«Total»«TableEnd:POLines »


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.



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. Save your changes – your new template will now be available to be selected. 




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




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. Then, return to the mail merge master list and look in the Purchase table for the supplier fax. Copy the field code.




  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 the Mail Merge master list 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. To allow the PO email template to be sent automatically to several suppliers at once, in the Configure Email Recipients section, set the All active users and All company contacts options to Yes
  9. If you have an Automation module subscription, you may also select a mailing list at this time (see Create a Mailing List for more information). You may also enter BCC addresses that will receive copies of all DEAR emails.
  10. 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.


To 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 PayPalPay}”==”” “<CustomImage>” “<CustomImage>” } OR { IF “{MERGEFIELD StripePay}”==”” “<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. 


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.

Did you find it helpful? Yes No

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