Difference between revisions of "Inbound Routing Rules"

From Hornbill
Jump to navigation Jump to search
Line 10: Line 10:
 
:*mail.autoresponder.enable and switch the value to 'on'
 
:*mail.autoresponder.enable and switch the value to 'on'
  
[[File:routing_rules.png|center|1000px|Email Routing Rules]]
+
[[File:routing_rules.png|center|700px|Email Routing Rules]]
 
To configure your rules to determine how emails are handled
 
To configure your rules to determine how emails are handled
 
*From your administration menu
 
*From your administration menu

Revision as of 12:18, 26 January 2016

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.

  • From your administration menu
  • Select Email
  • Settings
  • mail.autoresponder.enable and switch the value to 'on'
Email Routing Rules

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.


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)