Send Conditions

Overview
Send conditions allow you to set up rules by which email templates will be selected. This is very similar to Printing Conditions, that are used in document templates in Template Designer

Introduction

Sending conditions on email templates are designed so that you can tailor your emails to customers in the same way that template designer allows you to customise physical documentation produced by Linnworks. However, care should be taken when designing sending conditions to ensure that they perform as expected.

Linnworks will try and match a template by working through the list of available templates and picking the first one that matches the conditions set. Where there is a degree of ambiguity and a specific template meets multiple condition sets, it is not possible to guarantee the same condition set will be used. Therefore it is advisable to set use sending conditions with multiple clauses to ensure the correct template is used for the email.

Please Note! Send conditions have to be unique. If there is a template with the same send condition as a template you are working on, Linnworks will not allow you to save the condition. The name of the conflicting template will also be displayed .

Amazon FBA Orders

Due to Amazon policies on merchants fulfilling orders via FBA, Linnworks is not allowed to send despatch emails for Amazon FBA orders

Logical Operators

The following table is a brief summary of the logical operators used in the evaluation of sending conditions that are supported. If the sending condition in a template is true for any particular order (or other appropriate document) it will be used. A brief explanation is given in each case. For further information and examples of AND and OR operators, please see the Example Conditions section below.

OperatorExampleExplanation
AND [{Source}]="EBAY" AND [{cCountry}]="UNITED KINGDON" The AND operator is used to join variables such that the document must meet all conditions to use a particular template. The example would be true if the order came from eBay and is being delivered to somewhere in the UK
OR [{SubSource}]="EBAY0" OR [{SubSource}]="EBAY1" The OR operator is used to give alternative conditions for which a template will be used. The example would be true if the order came from EBAY1 or EBAY0
= [{Source}]="EBAY" The = operator is used to do exact comparison between values. The example would be true if the order came from eBay
<> [{Source}]<>"Amazon" The <> operator is used to specify non-equivalence between two values. The example would be true if the order did not come from Amazon
> [{fTotalCharge}]>100 The > operator states that the first value is greater than the second. The example would be true if the order total was over 100 of the order currency
< [{fTax}]<20 The < operator states that the first value is less than than the second. The example would be true if the order tax was less than 20 of the order currency
>= [{fTotalCharge}]>=100 The >= operator states that the first value is greater than or equal to the second. The example would be true if the order was 100 or more of the order currency
<= [{TotalWeight}]<=1500 The <= operator states that the first value is less than or equal to the second. The example would be true if the weight of the order is 1500 or less of the default order weight

Template Selection

Template selection in email conditions is slightly different to the template selection for physical document templates. Whilst there is no default template, it is possible to create one by creating a template that has no sending conditions. Template selection is done by comparing the email to the template sending conditions and using the first template where the conditions match. Templates will be evaluated in order of the number of parameters they contain, starting with the most. In the case that there are multiple templates with the same number of conditions, they will be evaluated in a random order and it cannot be guaranteed that a particular template will be chosen. For this reason, it is important to design sending conditions to be as specific as possible. For more information on condition design, please see the examples section below

Designing Send Conditions

Editing the conditions

  • Clicking the Edit button on a template will open the condition editor
  • Variables can be selected by clicking the  Tags. Highlighting a menu item will open a new menu showing all available tags in that category
  • Clicking Check Syntax will check the condition for valid code
  • Click  OK

Example Conditions

Source Specific Templates

The following code sample shows how template selection can influence the way conditions are designed:

  • Condition 1: [{Source}] <> "AMAZON" AND [{Source}] <> "EBAY"
  • Condition 2: [{Source}] = "3DCART"

In this example the email template associated with Condition 2 will never be used as it is fulfilled by Condition 1 and condition one has more parameters, so it will always be evaluated first. To allow Condition 2 to be used Condition 1 needs to changed to:

  • New Condition 1:[{Source}] <> "AMAZON" AND [{Source}] <> "EBAY" AND [{Source}] <> "3DCART"

Multiple Inclusive Conditions

In the above example, the first condition was an exclusive example. Using the OR operator can be used simplify the interactions between different templates by being explicitly inclusive. In the following example we have templates that are to be sent to customers who's shipping address is in France or who have ordered through one of our French Marketplaces. Similar conditions can be set on other language specific templates.

  • Condition:[{Source}] = "PRICEMINISTER" OR [{CountryId}] = "FR"

Using Multiple Or Conditions

In the following example the condition is designed to check for orders from a specific source and one of a range of Linnworks Postal Services'. The reason this may be done is that you can have multiple postal services that are all one type of shipping, for instance; express, for various parts of the world. Please note the use of brackets around the shipping services, highlighted in red for visibility. This is done to ensure that this section of the condition is evaluated as one section. Furthermore, when comparing the same tag multiple times, the tag need to be specified in each comparison.

  • Condition: [{Source}] = "AMAZON" AND ([{ShippingMethod}]="Speedy UK" OR [{ShippingMethod}] = "Speedy EU" OR [{ShippingMethod}] = "Speedy RoW")