Difference between revisions of "Inbound Routing Rules"

From Hornbill
Jump to navigation Jump to search
 
(85 intermediate revisions by 9 users not shown)
Line 1: Line 1:
__NOTOC__[[Main Page|Home]] > [[Administration]] > [[Email_Administration|Email]] > Email Routing Rules
+
This document can now be found at its new location in the [https://docs.hornbill.com/esp-config/email/using-email-routing-rules/ Hornbill Document Library].
  
==Introduction==
+
[[file:hornbill-document-library.png|Hornbill Cloud|link=https://docs.hornbill.com/esp-config/email/using-email-routing-rules/]]
 
+
<!--
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===
 
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide answer" data-expandtext="Show more" style="width:1050px">
 
In order to configure email to work you will need to enable your autoresponder function and set up your routing rules
 
<div class="mw-collapsible-content">
 
*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
 
 
 
===A Few Small Tips===
 
 
 
*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 be delivered to the mailbox. 
 
:*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 You Automate?===
 
 
 
Within Hornbill you can automate the following actions
 
  
*Routing of an email to a specified Mailbox and folder within that mailbox
+
<div style="border:1px solid #90C0FF; background:#D0E0FF; width:99%; padding:4px; margin-bottom:10px;">
:*Log a new Incident
+
__NOTOC__[[Main Page|Home]] > [[Administration]] > [[System Administration|System]] > [[Email_Administration|Email]] > Email Routing Rules
:*Update an existing Incident
 
:*Log a new Service Request
 
:*Update an existing Service Request
 
 
 
</div>
 
</div>
 +
{|style="width: 100%"
 +
|- valign="top"
 +
|style="width:73%"|
 +
==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.
 +
|style="width:5%"|
 +
|
 +
|style="width:22%; border-style: solid; border-width: 1px; border-color:#e6e6e6; background-color:#f2f2f2;"|
  
==Routing Rule Configuration Settings==
+
== Related Articles ==
 +
:* [[Routing Rule Templates|Service Manager Routing Rule Templates]]
 +
|}
  
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.
+
== Routing Rules List==
 
+
[[File:routingrule.png|thumb|300px|link=https://wiki.hornbill.com/images/0/0c/Routingrule.png|Email Routing Rule Form]]
===Options when setting up a rule===
+
From the list of Routing Rules there a few actions and some considerations to keep in mind.
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide Options" data-expandtext="Show Options" style="width:1050px">
+
:* '''Switching On or Off'''
There are a number of settings which need to be configured to determine the criteria to check for and the operation to be executed.
+
:: At the top of the list a toggle button is provided to turn the Routing Rules to being either On or Off.  This setting applies to all rules in this list. For the rules to be processed, this must be set to On.
 
+
:* '''Creating a Rule'''
<div class="mw-collapsible-content">
+
:: Clicking on the + in the tool bar will allow you to create a new rule.
:*'''Name''' - Name for your rule
+
:* '''Ordering'''
:*'''Rule Expression''' - Enter the explicit rule criteria you wish to check incoming email against
+
:: Once more than one rule has been created, the order of the rules can be changed by using the up and down arrows located on the right side of each rule. When an email is received, the routing rules will be processed in the order that they are listed, starting at rule 1. If a rule doesn't match it will then check the next rule. If no rules match the email will simply reside in the Inbox. 
:*'''Use Mailbox''' - If ticked this will enable the 'Mailbox' and 'Folder' fields allowing you direct incoming emails to a specific location
+
:: '''Note:''' If a rule matches, but its action fails to complete, no further rules will be checked and the rule's ''Fail'' action will be followed.
:**'''Mailbox''' - The mailbox you wish emails to be routed to
+
:* '''Deleting a Rule'''
:**'''Folder''' - The folder within a mailbox for email to be routed to
+
:: The Delete option in the tool bar becomes available once one or more Rules are selected in the list
:*'''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''' - If you are not using the out of the box call reference syntax then you can specify the REGEX match to search for your call reference.
 
<br>
 
<br>
 
[[File:routing_rules.png|center|700px|Email Routing Rules]]
 
<br>
 
 
<br>
 
<br>
</div>
 
  
===Service Manager Settings===
+
==Rule Expression==
 +
Each Routing Rule requires a Rule Expression which is used to validate information held within the email.  To help with setting up the Rule Expression a number of parameters have been provided in the Rule Parameters selector located at the top right of the Rule Expression field.  Selecting any of these items from the list will insert that Rule Parameter into the Rule Expression field.
  
When setting up Operations in the context of Service Manager you will need to set up default values for calls to be logged against.  If these are not set they will not be completed when the call is logged.
+
:* toAddress
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide Options" data-expandtext="Show Options" style="width:1050px">
+
:* toDomain
<div class="mw-collapsible-content">
+
:* ccAddress
#Open Hornbill Administration
+
:* ccDomain
#Select Service Manager from the Application selector in the top left
+
:* fromAddress
#Under the left hand menu option 'Application' and select 'Settings'
+
:* fromDomain
 
+
:* subject
 
+
:* body
====Available Settings====
+
:* mailbox
 
 
*'''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
 
  
 +
[[File:Information.png|14px|text-top|Information]] If you are manually adding Rule Parameters it is important that the correct letter case is used and it matches those provided in the Rule Parameters selector
  
[[File:routing_rules_settings.png|center|700px|Service Manager Routing Rules]]
+
=== Rule Expression Syntax ===
</div>
+
The syntax used in the Rule Expression is similar to standard SQL syntax. String and numeric comparisons, and parentheses are all supported.  
  
==Expressions==
+
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide Examples" data-expandtext="Show Examples" style="width:1050px">
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.
 
 
 
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide answer" data-expandtext="Show list of functions" style="width:1050px">
 
 
A few basic expressions to get you started can be found by showing the list of functions.
 
A few basic expressions to get you started can be found by showing the list of functions.
  
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
{| class="wikitable"
+
:{| class="wikitable"
| '''Function Name'''
+
| '''Function'''
 
| '''Example'''
 
| '''Example'''
  
 
|-
 
|-
 
|LIKE
 
|LIKE
|LIKE '%abc' or LIKE 'abc%' or LIKE '%abc%'
+
|subject LIKE '%abc' or subject LIKE 'xyz%' or subject LIKE '%mno%'
  
 
|-
 
|-
 
|NOT
 
|NOT
|NOT 1 or NOT (1 and NOT 2)
+
|subject != 'abc'
  
 
|-
 
|-
 
|NOT IN  
 
|NOT IN  
|NOT IN (1, 2)
+
|subject NOT IN ('abc', 'zyx')
  
 
|-
 
|-
 
|IN  
 
|IN  
|IN (1, 2, 3)
+
|subject IN ('abc', 'mno', 'xyx')
  
 
|-
 
|-
 
|=
 
|=
|Subject = 'abcd'
+
|subject = 'abcd'
  
 
|}
 
|}
Line 137: Line 84:
  
 
=== Special Functions ===
 
=== Special Functions ===
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide answer" data-expandtext="Show list of functions" style="width:1050px">
+
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide Functions" data-expandtext="Show Functions" style="width:1050px">
Hornbill supports a number of functions that are useful for more complex expressions and evaluations.  
+
Hornbill supports a number of functions that are useful for more complex expressions.  
  
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
Line 153: Line 100:
  
  
LEFT(“The Dog”, 3) = “The”
+
LEFT('The Dog', 3) = 'The'
  
 
|-
 
|-
Line 172: Line 119:
  
  
SUBSTRING(“The Dog”, 5) = “Dog”
+
SUBSTRING('The Dog', 5) = 'Dog'
  
  
SUBSTRING(“The Dog”, 5, 2) = “Do”
+
SUBSTRING('The Dog', 5, 2) = 'Do'
  
 
|-
 
|-
Line 187: Line 134:
  
  
RIGHT(“The Dog”, 2) = “og”
+
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
 
  
 
|-
 
|-
Line 219: Line 151:
  
  
CONCAT(‘The’, ‘ ‘, “Dog”) = “The Dog”
+
CONCAT(‘The’, ‘ ‘, 'Dog') = 'The Dog'
  
 
|-
 
|-
Line 226: Line 158:
  
  
REGEX_MATCH(“String to match”, “regex to test”)
+
REGEX_MATCH('String to match', 'regex to test')
  
  
This function is based on perl compatible regular expressions. Please see the following URL: -
+
This function is based on Perl compatible regular expressions. Please see the following URL: -
  
  
 
[http://www.pcre.org/ http://www.pcre.org/]
 
[http://www.pcre.org/ http://www.pcre.org/]
 +
 +
Example of a routing rule matching a request reference in the email subject: REGEX_MATCH(subject, '.*\b[a-zA-Z]{2}[0-9]{8}\b.*')
  
 
|-
 
|-
Line 242: Line 176:
  
  
This function is based on perl compatible regular expressions. Please see the following URL: -
+
This function is based on Perl compatible regular expressions. Please see the following URL: -
  
  
Line 253: Line 187:
  
 
STRING_REPLACE(''needle'', ''haystack'', ''string'')
 
STRING_REPLACE(''needle'', ''haystack'', ''string'')
 +
 +
|-
 +
| MESSAGE_HEADER
 +
| Return the value of one message header present in the email message being evaluated. If header is not present this will return NULL. Available in platform build 3801 onwards
 +
 +
 +
MESSAGE_HEADER('X-Header-Name')
 +
 +
 +
For example:
 +
 +
MESSAGE_HEADER('Message-ID') LIKE '%some.domain.com%'
  
 
|}
 
|}
 
</div>
 
</div>
 +
<br>
 +
 +
== Use Mailbox ==
 +
This option provides the simple routing of incoming emails to a particular Shared Mailbox.
 +
:*'''Mailbox'''
 +
::From the list of available Shared Mailboxes, select the mailbox that you wish emails that match the Rule Expression to be routed to.
 +
:*'''Folder'''
 +
::Select the folder within the selected Shared Mailbox for email to be stored in. This list of folders include the Inbox, Deleted Items, and any custom folder that has been added to the selected Shared Mailbox.
 +
 +
== Use Operation ==
 +
Each Hornbill App can provide Operations that provide advanced processing of emails.
 +
:*'''Application'''
 +
::Select an App to view the available operations for that particular App
 +
:*'''Operation'''
 +
::Select the operation that you wish to perform if your Rule Expression matches
 +
:*'''Target Folder Success'''
 +
::On a successful Rule Expression 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
 +
:::In order to aid troubleshooting it is recommended that this is not set to "Inbox" as this will make it easier to distinguish between emails that were not picked up by a Rule (which will remain in the Inbox) and emails that were picked up but failed to process correctly (which will move to the Failure Folder)
 +
:*'''Reference'''
 +
:: This field can be used by the selected operation in order to correctly process the selected Operation.  Refer to the application specific documentation to determine if this is required. 
 +
<br>
 +
==Service Manager Settings==
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide Options" data-expandtext="Show Options" style="width:1050px">
 +
When setting up Operations in the context of Service Manager you will need to set up default values for calls to be logged against. 
 +
 +
 +
<div class="mw-collapsible-content">
 +
#Open Hornbill Administration
 +
#Select Service Manager from the Application selector in the top left
 +
#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 recognized by their email address
 +
*'''app.email.routing.rules.unrecognised.email.template''' - The template used when sending emails to users who are not recognized by their email address
 +
 +
</div>
 +
 +
===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
 +
 +
Note: For ''logOrUpdateIncident'', ''logOrUpdateServiceRequest'' and ''updateRequest'' operations the '''Reference''' field is a mandatory parameter. You will need to specify the Regex Syntax that matches your (call) reference in the email's '''Subject'''.  E.g. for the standard out-of-the-box reference use: '''[a-zA-Z]{2}[0-9]{8}'''.
 +
 +
To match the same Reference format in the Rule Expression use the following: '''REGEX_MATCH(subject, '.*\b[a-zA-Z]{2}[0-9]{8}\b.*')'''
  
[[Category:Administration]][[Category:Email_Administration]]
+
[[Category:Administration]]
 +
-->
 +
[[Category:HDOC]]

Latest revision as of 19:56, 11 April 2024

This document can now be found at its new location in the Hornbill Document Library.

Hornbill Cloud