Editing Email templates

Overview
Email templates are managed in a similar way to other Linnworks templates, such as invoices or pick lists. They can be designed with fields that are filled in when they are generated before sending. This guide will cover how to create and edit these templates.

Table of Contents

Accessing the Screen

  1. Click Emails
  2. Click Email Notifications
  3. Open the Templates screen
    • To add a new Template, click  Add New  
    • To edit an existing Template, click  Edit 

Templates Screen Overview

In order to send emails through Linnworks using the available templates, you will need to enable them and specify the account details for a service to send them through, Name of the template and the Subject.

After clicking the Add New button and selecting a template, the template editing window will open. The following fields are available in this window:

Field Description
Type This is pre-set, depending on the template type: Automated or Manual.
Name (required) The name you wish to identify the template with.
Account (required) This is a drop-down menu of available accounts to send the email with.
Subject (required) This is the subject line of the email. It is possible to use tags in the subject line or functions such as [{EVAL}]. Only Order tags are available.
Attach PDF
(Dispatch Notification Template
and Manual-Processed only
)

Where supported Linnworks will automatically attach the relevant document in the form of a PDF, for example, the order invoice when sending
a despatch notification email.
Please note that disabling or enabling PDF attachments for a template will preserving the option disabled/enabled for future Emails.

Condition (Automates templates only) This is the circumstances in which the email will be sent. Only Order tags are available. For information on sending conditions, please see this guide.
Main Email Body This is an HTML template for the email. For information on editing templates, please see below.

Both subject and condition appear greyed out but can be modified by using the adjacent 'Edit' button. Although a plain text subject can be entered, this field allows for easy use of available TAGS the ability to check the entered syntax.

Creating Templates

There are two ways that templates can be edited; either by using the Visual Editor or by entering HTML.

Visual Editor

The Visual Editor is a WYSIWYG editor that resembles a standard word processing interface. The menu bar also contains two menus that are specific to Linnworks emails; TAGS and EVAL

Tags

Tags are a way of inserting information from Linnworks into your documentation at the point they are generated. The following is a table of all the currently available tags and a description of the information that will replace them. Examples of templates can be found here.

Menu Section Tag Name Description
Items Foreach Items This is used as a wrapper to create a list of the item related tags used between them. See the Foreach section below for more information.
  Order Item Title This is the title of the order item.
  Channel Title This is the title for the item on the original listing.
  Source This is the channel that the order came from, for instance; Amazon or eBay.
  Quantity This is the number of the order item that was ordered.
  Is Service This will display whether the order item was a service, such as gift-wrapping, which will not have a Linnworks stock item.
  SKU This is the Linnworks stock item SKU.
  Order Item Number This is a unique row identifier for the order item.
  Order Item Price per Unit This is the price paid per unit, inclusive of tax.
  Order Item Channel SKU This is the SKU given by the channel for the order item and may not match the Linnworks Stock Item SKU.
  Sales Tax This is the amount of tax paid on the order item.
  Tax Rate This is the tax rate for the order item.
  Tax Cost Inclusive This is given as either True or False and specifies whether the unit cost from the channel includes tax.
  Cost This is the cost of the item exclusive of tax.
  Cost Include Tax This is the cost of the item inclusive of tax.
     
Items > Composites Foreach Composites This is used as a wrapper for composite items in the order.
  Title This is the title of the composite child item.
  SKU This is the Linnworks SKU for the composite child item.
  Quantity This is the number of this child item defined in the composite, multiplied by the number of the composite item ordered.
  Channel Title This is the title for the item on the original listing.
Notes FOREACH Notes This is used as a wrapper to display the requested note related tags for all notes on the order.
  Notes This is the main body of the note.
  Date This is the date and time that the note was added to Linnworks.
  User This is the username of the person that added the note.
  Is Internal This is a TRUE/FALSE field that states whether the note was marked for internal purposes only.
     
Order Order Id This is the Linnworks Order Id given to the order.
  Source This is the channel that the order was downloaded from.
  Subsource This is the specific integration that the order was downloaded from.
  Reference number This is the reference number, typically the channel order number, associated with the order.
  Channel reference number This is a secondary reference number associated with an order.
  External reference number This is another reference number, typically used by eBay, for the order.
  Channel buyer name This is the username of the person that placed the order on the site or marketplace, typically used by eBay.
  Is processed This is a true/false field to show whether the order has been processed.
  Marker This is a number, between 0 and 7, that represents order tags that have been assigned to the order. The exception being 0, which means no tag has been set on the order and 7 which means the order has been 'Parked'.
  Received on This is the date and time at which the order was placed on the channel.
  Paid on This is the date and time at which the order was marked as paid on the channel.
  Dispatch by This is the date by which the order should be despatched. This is used by some channels, such as Newegg, but in other cases will show a default of 24 hours after the Created Date.
  Processed on This is the date and time at which the order was processed in Linnworks.
     
Order > Billing Address Address formatted This is the entire billing address, formatted with appropriate line breaks, in a single tag.
  Full name This is the name entered on the billing address.
  Company This is the company entered on the billing address.
  Address 1 Line 1 of the address used for billing purposes.
  Address 2 Line 2 of the address used for billing purposes.
  Address 3 Line 3 of the address used for billing purposes.
  Town This is the town entered on the billing address.
  Region This is the region or county entered on the billing address.
  Country This is the full name of the country entered on the billing address.
  Postal code This is the postal or zip code entered on the billing address.
  Phone number This is the phone number associated with the billing address.
  Email address This is the email used for billing purposes.
     
Order > Delivery Address Address formatted This is the entire shipping address, formatted with appropriate line breaks, in a single tag.
  Full name This is the name of the order recipient.
  Company This is the name of the company that the order will be shipped to.
  Address 1 This is the first line of the shipping address.
  Address 2 This is the second line of the shipping address.
  Address 3 This is the third line of the shipping address.
  Town This is the town that the order is to be shipped to.
  Region This is the county or region that the order is to be shipped to.
  Country This is the country that the order will be shipped to.
  Postal code This is the postal or zip code on the shipping address.
  Phone number This is the phone number associated with the shipping details.
  Email address This is the email used for despatch purposes.
  Country Id This is the ISO country code for the destination country.
  Country tax rate This is the tax rate, as defined in Linnworks' general settings, for the country.
     
Order > Postage Postal Tracking Number This is the tracking number associated with an order. Please note that if no number specified, this will appear blank.
  Shipping Method This is the Linnworks Postal Service that has been applied to the order.
  Shipping Vendor This is the name of the courier that is assigned to the order.
     
Order > Totals Currency This is the order currency, as downloaded from the channel.
  Subtotal This is the total cost of the order, excluding tax and postage costs.
  Postage cost exclusive tax This is the postage cost, exclusive of tax.
  Postage cost This is the postage costs including tax.
  Postage discount This is the discount applied to the postage costs.
  Total discount This is the total amount of discount applied to the order.
  Tax This is the total tax for the order items.
  Order Total This is the order total, including all shipping and tax costs.
Out of stock items FOREACH Out of stock item This is used as a wrapper for every Out of stock item. Please note that only order items that are linked to out of stock inventory items will be included in the email.
  Order item title This is the title of the Out of stock item.
  Quantity This is the number of the order item that was ordered.
  SKU This is the Linnworks stock item SKU.
  Channel title This is the title for the item on the original listing.
Refunds (available for Refund 
and Returns Templates)
Refund Total  This is the total amount of the refund.
  Actioned Total  This is the total amount of the refund that has been actioned.
  For each Refunds  This is used as a wrapper for every item refunded.
  SKU  This is the Linnworks stock item SKU.
  Item Title  This is the title of the item.
  Reason  This is the Reason why the refund has been booked/actioned.
  Amount  This is the amount refunded.

EVAL

These functions are covered in more detail in our dedicated Expressions documentation. Clicking the function type will take you to the documentation for that type.

Function Name Function Type Brief Description
IIF Operators This performs an If-else-end function where the If takes a logical comparison
CONCAT String This joins strings of characters together
REPLACE String This function is used to replace a given character string with another
Today Date and Time This returns today's date in yyyy-mm-dd format
N2 Arithmetic This rounds the selected tag or string of numbers to 2 decimal places
ROUND Arithmetic This rounds the selected tag or string of numbers to a given number of decimal places

HTML Source

Clicking this tab will show the raw HTML view. If you would prefer to paste in a pre-prepared HTML template and then add in the appropriate Linnworks tags it is possible to paste in the HTML and then switch to the Visual Editor. Alternatively, use the visual editor then click Tools > Source Code , then paste in your HTML code and click OK

Using HTML and EVAL tags together

Due to the way EVAL tags are handled, using HTML, such as a link to an external resource, needs to be handled carefully to get the desired result. The following example shows how you might make an automatic link to a shipping vendor tracking website if there is a tracking number added to the order.

 [{EVAL}]IIF[[{ShippingVendor}]="My Shipping", concat["www.myshipping.com/track?id=", [{PostalTrackingNumber}]], ""][{ENDEVAL}]

The IIF statement checks whether the vendor is "My Shipping", this would be substituted with Royal Mail, FedEx etc. If the IIF statement is true the concat will join the URL that you have specified (in this case: www.myshipping.com/track?id=) and the tracking number that is stored in the Linnworks order. If the IIF statement is false, it will display nothing.

If your shipping vendor doesn't have a way to directly link to package tracking, remove the concat[] statement and replace it with the URL to the tracking website, for instance: https://www.royalmail.com/track-your-item. The approach above can be extended by repeating the code above, including EVAL and ENDEVAL statements. As an order can only have 1 shipping vendor and so every other vendor's tracking link would be hidden as the IIF statement will be false.

Foreach Tags

In the tags section, there are a number of tags that begin FOREACH. These are a way of iterating through each order item in the order or composite child item in the composite order item etc. The tag is made up of two parts: [{FOREACH(Items)}] and [{ENDFOR}], where (Items) can also be (Notes) or (Composites), as appropriate.

Using Foreach Tags

The Foreach tags themselves will show no data. You need to specify what data you would like to show, which will show for every note on the order or order item in the order etc. The following is an example that may be used on a despatch email to detail the title, quantity and line total for each item that has been ordered, putting the data in a table:

<table border="0"width="806"cellspacing="0"cellpadding="0">
 <thead>
  <tr>
   <th align="left" bgcolor="#eaeaea" width="521">Item Information</th>
   <th width="10"> </th>
   <th align="right" bgcolor="#eaeaea" width="75">Qty</th>
   <th align="right" bgcolor="#eaeaea" width="100">Cost (Each)</th>
   <th align="right" bgcolor="#eaeaea "width="100">Cost</th>
  </tr>
 </thead>
</table> 
<!-- Place items in a new table to ensure default browser behaviour does not move tags --> 
[{FOREACH(Items)}]
<table border="0" width="806" cellspacing="0" cellpadding="0">
 <tbody>
  <tr>
   <td align="left" valign="top" width="521">
    [{ItemNumber}] | [{ItemTitle}] 
   </td>
   <td width="10"> </td>
   <td align="right" valign="top" width="75">[{ItemQuantity}]</td>
   <td align="right" valign="top" width="100">[{ItemPricePerUnit}]  [{Currency}]</td>
   <td align="right" valign="top" width="100">[{ItemCostIncTax}]  [{Currency}]</td>
  </tr>
 </tbody>
</table> 
[{ENDFOR}]

This will produce a table similar to the following when the email is previewed or sent:

Item Title Quantity Ordered Line Cost (inc Tax)
Product 1 2 10 GBP
Product 2 1 12 GBP
Product 3 5 50 GBP

The above example is created as two separate HTML tables. The first table contains the header information. The item information is written as a separate table, which solves issues some browsers were having with tables and FOREACH loops. Whilst this approach is known to work, there may be other ways to achieve the desired effect, but they should be tested in a variety of browsers and clients to ensure that the results are consistent.

Please note! The exact style of the table will depend on any linked stylesheets or inline style elements that are specified.

IIF Tags and Foreach Loops

It is possible to use IIF statements in Foreach loops. Care should be taken when writing IIF tags so that the line will appear as intended if the IIF statement is false. For instance, if you wish to have order notes in the email, that does not display if the note is marked as internal; the code would have to be constructed as follows:

[{FOREACH(Notes)}] 
[{EVAL}]IIF[[{NoteInternal}]="True","",[{Note}]][{ENDEVAL}] 
[{ENDFOR}]

The above code will check whether the note is internal. If it is internal display "  ", which will actually display nothing. If the note is public, then display the note.

Next Steps