Inbound Routing Rules
Introduction
Once emails arrive in your Hornbill instance, it is possible to configure certain actions based on the email content. This behaviour is dertermined by the criteria you specify within your Email Routing Rules.
Configuring Routing Rules
In order to configure email to work you will need to enable your autoresponder function and set up your routing rules
- From your administration menu
- Select Email
- Settings
- mail.autoresponder.enable and switch the value to 'on'
To configure your rules to determine how emails are handled
- From your administration menu
- Select Email
- Routing Rules
- Use the Add Rules function
Expressions
The Hornbill platform makes use of a generic expression parser/evaluator to provide functional decision making capability.
The expression evaluator is based on the same syntax and notation as an SQL database, this is done to ensure that DBA’s and other technical people familiar with SQL databases can easily get to grips with building application within Supportworks ESP.
Routing Rule Syntax
The syntax used is the same that you find in any other standard SQL implementation. String and numeric comparisons, parentheses etc are all supported in the standard and expected way. In the absence of a detailed breakdown of the fill syntax, below is a full list of all of the test cases that are used to validate the expression parsers behaviour in our production systems.
Special Functions
Hornbill supports a number of functions that are useful for more complex expressions and evaluations.
Function Name | Description |
LEFT | Return the leftmost number of characters specified.
|
MID | Same as SUBSTRING() |
SUBSTRING | Return a substring starting from the specified position.
SUBSTRING (string, pos, length)
|
RIGHT | Returns the rightmost ‘length’ characters from the ‘string’
RIGHT(string, length)
|
BITCHECK | Returns ‘true’ or ‘false’ after testing the ‘bit’ specified. The bit can be specified as any number between 1-32, the ‘value’ should be a 32bit unsigned number
BITCHECK(0x00000002, 2) = true |
TOKEN | Assumes that whitespace is a token separator, this function will return the token specified. The line and token values are zero based, so to obtain the first word in the first line, line=0 and token=0
|
CONCAT | Takes any number of arguments and concatenates them all together returning a string.
|
REGEX_MATCH | Returns a true/false depending on the outcome of the regular expression match against the supplied string.
|
REGEX_SUBSTR | Returns a substring of the provided ‘string’ based on the provided regular expression.
|
STRING_REPLACE | Replaces all occurrences of needle in haystack and returns the resultant string:
|