Difference between revisions of "Inbound Routing Rules"

From Hornbill
Jump to navigation Jump to search
Line 1: Line 1:
 
__NOTOC__[[Main Page|Home]] > [[Administration]] > [[System Administration|System]] > [[Email_Administration|Email]] > Email Routing Rules
 
__NOTOC__[[Main Page|Home]] > [[Administration]] > [[System Administration|System]] > [[Email_Administration|Email]] > Email Routing Rules
 
+
[[File:RoutingRulesCard.png|right|Routing Rules]]
 
==Introduction==
 
==Introduction==
 
The Email Routing Rules provide a way of automating the delivery and actions that occur on emails that are received into Hornbill.  This may be simply redirecting the email message to a particular shared mailbox or applying advance operations that are provided by the different Hornbill Apps.  Each Email Routing rules allow you to define expressions to verify the content of the incoming emails in order for that rule to apply.
 
The Email Routing Rules provide a way of automating the delivery and actions that occur on emails that are received into Hornbill.  This may be simply redirecting the email message to a particular shared mailbox or applying advance operations that are provided by the different Hornbill Apps.  Each Email Routing rules allow you to define expressions to verify the content of the incoming emails in order for that rule to apply.

Revision as of 17:01, 10 October 2016

Home > Administration > System > Email > Email Routing Rules

Routing Rules

Introduction

The Email Routing Rules provide a way of automating the delivery and actions that occur on emails that are received into Hornbill. This may be simply redirecting the email message to a particular shared mailbox or applying advance operations that are provided by the different Hornbill Apps. Each Email Routing rules allow you to define expressions to verify the content of the incoming emails in order for that rule to apply.


Creating Routing Rules and Enabling Auto Routing

In order to configure email to work you will need to set up your routing rules and switch on your autoresponder function. This is done via Hornbill Administration.

To configure your rules to determine how emails are handled:

  1. In the context of Instance Configuration select Email > Routing Rules
  2. Click the "Add New Rule" button to begin defining your rule expression and the action to be performed if an email matches the rule criteria.
  3. Click "Create Rule" to Save your new rule

To enable auto responder after defining your rules:

  1. In the context of Instance Configuration select Email > Settings
  2. Toggle the application setting mail.autoresponder.enable to 'ON'


Things to Consider Before Enabling Auto routing

  • When an email is received, the routing rules will check the email to see if it meets the rule expression (criteria to look for) specified. If rule 1 doesn't match it will then check rule 2 and so on. Therefore you will need to ensure your email rules are ordered correctly.
  • If no rules match the email will simply reside in the Inbox.
  • When setting up a rule you will need to state explicit criteria to match on. For example if you want users to users to log incidents you may ask them to specify the word ‘Incident’ in the Subject line so you can create a rule to identify this word in the criteria.
  • You may also decide on a third rule as a catch all which you would need to decide which call class you would prefer to be logged against.
  • You will need to specify some exceptions to cater for automatic replies such as ‘Out of office’ otherwise you can end up spamming back and forth with calls being logged or updated each time.
  • If you are not sending an email automatically on call logging to your customers, you will need to update this in the Business Process to do so.

What Actions Can be Performed based on a Matching Rule?

Within Hornbill you can automate the following actions

  • Routing of an email to a specified Mailbox and folder within that mailbox
  • Log a new Incident
  • Update an existing Incident
  • Log a new Service Request
  • Update an existing Service Request


Routing Rule Configuration Settings

Each Routing Rule must be set up individually. You can set up as many rules as you wish but once a rule has been matched it will execute the operations specified. It is therefore important to sequence your Routing Rules in the order you wish them to be executed.

Options when setting up a rule

There are a number of settings which need to be configured to determine the criteria to check for and the operation to be executed.

  • Name - Name for your rule
  • Rule Expression - Enter the explicit rule criteria you wish to check incoming email against
  • Use Mailbox - If ticked this will enable the 'Mailbox' and 'Folder' fields allowing you direct incoming emails to a specific location
    • Mailbox - The mailbox you wish emails to be routed to
    • Folder - The folder within a mailbox for email to be routed to
  • Use Flowcode - If ticked this will enable automate application specific actions
    • Application - The Application in which tasks (operations) will be automated - (currently only operations are available in the context of the Service Manager Application)
    • Operation - The Task you wish to automate if your rule matches
  • Target Folder Success - On a successful rule match the folder you would like the email routed to
  • Target Folder Failure - In the case of a rule match but action failure the folder you would like the email routed to
  • Reference - You will need to specify the Regex Syntax that matches your call reference. E.g. for the standard out-of-the-box reference use: [a-zA-Z]{2}[0-9]{8}

Note: For logOrUpdateIncident, logOrUpdateServiceRequest and updateRequest operations the Reference field is a mandatory parameter. Therefore for the rule to work with these operations you must have a valid regular expression specified in this field.

Email Routing Rules



Service Manager Settings

When setting up Operations in the context of Service Manager you will need to set up default values for calls to be logged against.


  1. Open Hornbill Administration
  2. Select Service Manager from the Application selector in the top left
  3. Under the left hand menu option 'Application' and select 'Settings'


Available Settings

  • app.email.routing.rules.allow.closed.call.updates.IN - Switch on to enable closed Incidents to be updated via a routing rule
  • app.email.routing.rules.allow.closed.call.updates.SR - Switch on to enable closed Service Requests to be updated via a routing rule
  • app.email.routing.rules.default.priority.IN - Set a default Priority for Incidents on logging
  • app.email.routing.rules.default.priority.SR - Set a default Priority for Service Requests on logging
  • app.email.routing.rules.default.service.IN - Set a default Service for Incidents on logging
  • app.email.routing.rules.default.service.SR - Set a default Service for Service Requests on logging
  • app.email.routing.rules.default.team.IN - Set a default team for allocating Incidents on logging
  • app.email.routing.rules.default.team.SR - Set a default team for allocating Service Requests on logging
  • app.email.routing.rules.unknownUsers.sendConfirmation - Send an email to users who are not recognised by their email address
  • app.email.routing.rules.unrecognised.email.template - The template used when sending emails to users who are not recognised by their email address


Service Manager 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 Hornbill.


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”

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)