Difference between revisions of "Inbound Routing Rules"

From Hornbill
Jump to navigation Jump to search
Line 1: Line 1:
 +
__notoc__[[Main Page|Home]] > Getting Started
 +
 
==Introduction==
 
==Introduction==
  

Revision as of 14:37, 26 January 2016

Home > Getting Started

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
Email Routing Rules

Expressions

The Hornbill platform makes use of a generic expression parser/evaluator to provide functionality.

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.

A few basic expressions to get you started can be found by showing the list of functions.

Function Name Example
LIKE LIKE '%abc' or LIKE 'abc%' or LIKE '%abc%'
NOT NOT 1 or NOT (1 and NOT 2)
NOT IN NOT IN (1, 2)
IN IN (1, 2, 3)
= Subject = 'abcd'

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.


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


TOKEN(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/

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


STRING_REPLACE(needle, haystack, string)