Inbound Routing Rules

From Hornbill
Revision as of 11:54, 26 January 2016 by NealW (talk | contribs)
Jump to navigation Jump to search

Email 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.

In order to configure email to work you will need to enable your autoresponder function.

  1. From your administration
    1. Select Email
    2. mail.autoresponder.enable and switch the value to 'on'

To configure your rules to determine how emails are handled

  1. From your administration
    1. Select Email
    2. Routing Rules
    3. 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.


Core Function Reference

As well as the basic string and math capabilities identified above, the expression engine supports a number of functions that are useful for more complex expressions and evaluations. These functions are available in all places within the application where the expression engine is utilised


Function Name Description
LEFT Return the leftmost number of characters specified.


For example:


LEFT(“The Dog”, 3) = “The”

MID Same as SUBSTRING()
SUBSTRING Return a substring starting from the specified position.


SUBSTRING(string, pos)

SUBSTRING (string, pos, length)


For example:


SUBSTRING(“The Dog”, 5) = “Dog”


SUBSTRING(“The Dog”, 5, 2) = “Do”



RIGHT Returns the rightmost ‘length’ characters from the ‘string’


RIGHT(string, length)


For example: -


RIGHT(“The Dog”, 2) = “og”

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(value, bit)


For example: -


BITCHECK(0x00000002, 1) = false

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


TOEKN(string, line, token)



CONCAT Takes any number of arguments and concatenates them all together returning a string.


For example: -


CONCAT(‘The’, ‘ ‘, “Dog”) = “The Dog”



REGEX_MATCH Returns a true/false depending on the outcome of the regular expression match against the supplied string.


REGEX_MATCH(“String to match”, “regex to test”)


This function is based on perl compatible regular expressions. Please see the following URL: -


http://www.pcre.org/



REGEX_SUBSTR Returns a substring of the provided ‘string’ based on the provided regular expression.


REGEX_SUBSTR(string, regex)


This function is based on perl compatible regular expressions. Please see the following URL: -


http://www.pcre.org/



CALLREF_VALUE Given a formatted call reference value, this function returns the raw numeric value. For example: -


CALLREF_STRING(‘F0000099’) = 99

STRING_REPLACE Replaces all occurrences of needle in haystack and returns the resultant string:


STRING_REPLACE(needle, haystack, string)

TIME Returns the current Date/Time as a string in ISO8601 format. Optionally, you can provide an EPOCH time, in which case it will return the ISO8601 formatted representation of the time specified.


TIME([opt]epoch_time)

EPOCH Returns the current Date/Time as an EPOCH time. Optionally you can provide an ISO8601 formatted date time and this function will return an EPOCH representation of that time


EPOCH([opt]time)