Email Routing Rules

Email routing rules send each new inbound email to a team or a flow based on who sent it, who it was addressed to and its subject, and can send the sender an automatic acknowledgement.

Setting Up Email Routing

Every new email becomes a ticket. Routing decides which team’s queue it lands in, or which flow handles it first. Work through these decisions in order; each links to the section that explains it in full.

  1. Make sure mail reaches RapiDesq. Connect a mailbox or set up a forwarding address on the Connections tab. Rules only see mail that arrives one of those two ways. See Email Channel.
  2. Decide where ordinary mail goes. Most mail should not need a rule. Give each mailbox or forwarding address its own routing on the Connections tab, and pick a Fallback team for unmatched mail on the Pattern Rules tab for anything that is left. Without either, unmatched mail becomes a ticket with no team. See What Happens When No Rule Matches.
  3. Add a rule for each exception, such as invoices for Billing or press mail for Marketing. For each rule, decide:
    • Which mail it watches (Applies To): all inbound email, one mailbox, or one forwarding address. This cannot be changed later. See Step 1: Source.
    • What it looks for: To, CC and From addresses and subject words, with * as a wildcard. See Step 2 and How Patterns Match.
    • Where matching mail goes: Direct to Team puts the ticket in a team’s queue; Through Flow runs a flow on it first (Professional and Enterprise). See Where Matching Mail Goes.
    • Whether the sender gets an automatic reply, and which template it uses. Create the template first on the Templates tab. See Auto-acknowledgements and Email Templates.
  4. Put the rules in order. When two rules could match the same email, the lower Priority number wins. Every new rule starts at 0, so edit a rule to change its priority. See How a Rule Is Chosen.
  5. Check the result. Send a test email that should match, and check which team the ticket landed on and which rule sent it there. See Checking Where an Email Went.

Where to Find Them

Open Admin > Channels > Email and select the Pattern Rules tab. The tab shows two things:

Before the first rule exists, the list shows No email routing rules with an Add Rule button. Until a fallback team is chosen, the card above it warns: “No fallback team is set. Unmatched mail is created without a team, so no team’s queue shows it: only people who can see all teams’ tickets will find it.”

The tab before any rule or fallback team The tab before any rule or fallback team.

Owners and Admins can open the tab and change everything on it. For anyone else, see Permissions and Plan Availability.

How a Rule Is Chosen

When the first message of a new email conversation arrives, RapiDesq tries the active rules that apply to it, one by one, and the first rule that matches decides where the message goes. A rule applies to a message when its Applies To is All inbound email, or is the mailbox or forwarding address the message arrived on. Replies to an existing conversation stay on that conversation’s ticket; rules are not tried again for them.

Rules are tried in this order:

  1. Priority: lower numbers first. A rule with priority 0 is tried before a rule with priority 10.
  2. At the same priority, a rule for a specific mailbox or forwarding address is tried before a rule for All inbound email.
  3. After that, the older rule first.

Inactive rules are skipped. The list on the Pattern Rules tab is sorted by priority, so you can read the order from its Priority column.

A rule is tried only once per email, when its conversation starts. Changing a rule later never moves tickets that already exist.

Where Matching Mail Goes

A rule sends the email it matches to one of two destinations, chosen under Routing Mode. Either way the email becomes a ticket at once, and the sender’s later replies join that ticket.

Routing Mode What happens What your team sees What the sender experiences
Direct to Team
“Route matching emails directly to a team for user assignment”
The ticket is created on the team you choose under Select Team, and that team’s routing takes over: it is offered or assigned to a member, or waits in the team’s queue, according to the team’s assignment mode.The ticket in the team’s queue, or an offer to a member who is available and has capacity.Nothing until someone replies, unless the rule sends an acknowledgement. Replies from your team arrive as email in the same thread.
Through Flow
“Process matching emails through a conversation flow before routing”
The ticket is created with no team, and the flow you choose under Select Flow starts on it straight away. The flow’s Route to Team step is what puts the ticket in a team’s queue.Nothing in a queue until the flow routes the ticket. A flow path that ends without routing it leaves the ticket on Unrouted Tickets.Whatever the flow’s steps send, then your team’s replies once a team has the ticket.

If the flow cannot start, for example because your plan no longer includes flows, the ticket keeps no team and appears on Unrouted Tickets. How a team offers and assigns its tickets is set on the team; see Routing Strategies & Queues.

What Happens When No Rule Matches

A message that matches no rule is routed the way its source is routed:

  1. The routing set on the mailbox or forwarding address itself (on the Connections tab, in the connection’s Routing section). See Email Channel: Routing Configuration.
  2. If the source has no routing of its own, the Fallback team for unmatched mail.
  3. If there is no fallback team either, the ticket is created without a team. No team’s queue shows it; only people who can see every team’s tickets will find it. See Unrouted Tickets.

To set the fallback team, pick a team under Fallback team on the Pattern Rules tab. It is saved as soon as you pick it. Remove fallback clears it. If unmatched mail currently goes to a flow or a bot, the card says “Unmatched mail currently goes to a flow or bot. Choosing a team here replaces that.” If the choice cannot be saved, the card shows “The fallback team could not be saved. Try again.”

The fallback team does not use one of your plan’s channel connections. A team that is the fallback cannot be deleted until you choose another fallback or remove it: the team’s delete screen lists it as “Email to any mailbox without its own route”.

The fallback team card with Support chosen The fallback team card with Support chosen.

Creating a Rule

Click Add Rule. The Create Routing Rule wizard has four steps: Source, What to match, Where to send it and Review & Confirm. Next moves on once the step is complete, Back returns to the step before, and Cancel closes the wizard without saving anything.

Step 1: Source

The source cannot be changed once the rule exists. To route a different source, create a new rule.

Wizard step 1 filled in Wizard step 1 filled in.

Step 2: What to match

Four fields, each a list. Type an entry and press Enter after each one; an entry you type and then leave is added too. Each entry shows as a chip, and its × removes it.

Wizard step 2 with To and Subject entries Wizard step 2 with To and Subject entries.

The wizard asks for at least one entry in at least one field: with every field empty, Next shows “Add at least one address or subject pattern, otherwise this rule matches every message on the mailbox.” A rule with no entries at all would match every message from its source.

Wizard step 2: Next with every field empty Wizard step 2: Next with every field empty.

Step 3: Where to send it

Wizard step 3 filled in (Billing, acknowledged) Wizard step 3 filled in (Billing, acknowledged).

Step 4: Review

Review & Confirm states the rule back: Name, Email Connection (the source), From, To, CC, Subject (each field’s entries joined by “or”, or Not set), Routing Target and Priority. Click Create.

Wizard step 4, Review & Confirm Wizard step 4, Review & Confirm.

The wizard then shows Created Successfully. Done closes it. Create Another starts the next rule with the same source and destination and a numbered name (“Invoices 2”); the patterns and the acknowledgement are cleared.

Created Successfully, with Create Another Created Successfully, with Create Another.

A new rule starts at priority 0 and is active. To change its priority, edit it.

How Patterns Match

Each entry can be up to 255 characters. Blank entries are dropped when you save.

Editing, Switching Off and Deleting

Use the pencil icon on a rule’s row to open Edit Routing Rule. It holds Rule Name; Applies To, shown but fixed; Priority; the four fields under Match Patterns; Routing Mode with its Select Team or Select Flow under Routing Target; Auto-acknowledge matching emails with its Acknowledgement Template; and Active. Click Save to keep the changes. On a plan without flows, Through Flow is greyed out here and says what is missing.

Edit Routing Rule for "Press enquiries" Edit Routing Rule for "Press enquiries".

The Acknowledgement Template list in this dialog offers your active acknowledgement templates and Default template. Choosing Default template saves no template today: a rule that already had a template keeps sending it, and a rule that never had one sends no acknowledgement. Pick a named template.

In the edit dialog you can empty every match field. The rule then matches every new message from its source, so give it a high priority number if you mean it as a catch-all.

Switch Active off to keep a rule without using it. The list shows it as Inactive, and it is skipped until you switch it back on.

The bin icon opens Delete Routing Rule; click Delete to remove the rule, or Cancel to keep it. Emails it used to match are then routed by the next matching rule, or as unmatched mail.

The Delete Routing Rule confirmation The Delete Routing Rule confirmation.

A team that a rule routes to with Direct to Team cannot be deleted, whether the rule is active or not: the team’s delete screen says it “can’t be deleted yet” and lists “The “rule name” email routing rule”, with “(all mailboxes)” after it for an All inbound email rule. Point the rule at another team, or delete it, first. Disconnecting a mailbox deletes the rules that apply to that mailbox.

If something a rule names no longer exists, the list says so instead of a name: Unknown source under Email Connection (for example a forwarding address that was removed), or Unknown Team or Flow: Unknown Flow under Routing Target. Edit the rule to choose a new destination, or delete it; a rule whose source is gone can no longer match anything.

Auto-acknowledgements

With Auto-acknowledge matching emails on, a new message that matches the rule gets one automatic reply, however it arrived (a connected mailbox or a forwarding address).

Checking Where an Email Went

Every new email’s routing is recorded. Open Routing Decisions, find the ticket’s entry, and open its details. Its Outcome says what decided the email’s destination, and Decision Factors say why:

Routing Decisions is on the plans that include interaction tracking (Professional and Enterprise). Owners, Admins and Supervisors can open it, and so can anyone with the Interaction Visibility permission set; see Routing Strategies: Routing decisions. Without it, the ticket’s team is the best clue: a ticket on the rule’s team was matched by the rule.

Worked Example: Sending Invoices to Billing

Mail to support@ is handled by the Support team, but anything about invoices sent to billing@ should go to Billing, and should be acknowledged.

  1. On Pattern Rules, set Fallback team to Support.
  2. Click Add Rule. Name it “Invoices”, and under Applies To choose All inbound email. Click Next.
  3. Under To addresses, add billing@acmeoutdoors.com. Under Subject patterns, add *invoice*. Click Next.
  4. Leave Direct to Team and choose Billing under Select Team. Switch on Auto-acknowledge matching emails and choose your acknowledgement template. Click Next.
  5. Check the review, click Create, then Done.
The worked example's "Invoices" row The worked example's "Invoices" row.

A message to billing@acmeoutdoors.com with the subject “Invoice 4411 overdue” matches and goes to Billing. A message to billing@acmeoutdoors.com about “Password reset” does not match, because both fields must match, so it goes to the source’s routing or to Support.

Permissions and Plan Availability

Troubleshooting

What you see Likely cause What to do
Email lands on the wrong teamAnother rule with a lower priority number matched first, or no rule matched and the source’s routing or the fallback team took itOpen the ticket on Routing Decisions and read Matched rule and Addresses considered; then change the priorities or the patterns (see How a Rule Is Chosen).
A rule never matchesThe rule is Inactive; a subject entry has no * and so must equal the whole subject; a CC entry is set and the email has no CC line; or the rule watches a different mailbox or forwarding addressSee How Patterns Match. Use *word* to match a word anywhere in a subject.
A rule matches far more mail than intendedEvery match field is empty, so the rule matches every new email from its sourceEdit the rule and add at least one address or subject entry, or give it a high priority number so other rules are tried first.
A customer’s reply was not routed by the rulesRules only route the first email of a conversationThat is expected: replies join the existing ticket.
Tickets from email have no team; the Pattern Rules tab warns “No fallback team is set”No rule matched, the mailbox or forwarding address has no routing of its own, and there is no fallback teamPick a Fallback team, or give the source its own routing. Move the waiting tickets from Unrouted Tickets.
Flow-routed tickets reach no teamA path of the flow ends without Route to Team, the flow is not published, or your plan no longer includes flowsCheck the flow (see Conversation Flows) or switch the rule to Direct to Team.
Create fails on a Through Flow ruleYour plan does not include the flow builder and advanced routingUse Direct to Team, or change plan (see Permissions and Plan Availability).
Create on the review step, or Save in the edit dialog, shows an errorA rule with the same name already exists for the same source, or an entry is longer than 255 characters, or the name longer than 100Choose another name or shorten the entry.
The sender gets no acknowledgementThe rule has no template (or Default template on a rule that never had one); the template was deleted or its body is empty; no connected mailbox can send; the email was a reply, or automatic mail such as an out-of-office; or Outbound delivery is set to SuppressOpen the rule with the pencil icon and pick a named template; check the Connections tab and General Settings. See Auto-acknowledgements.
The sender keeps getting an old acknowledgement after you switched the template offSwitching a template off does not stop rules that already use itChoose another template on the rule, or switch off Auto-acknowledge matching emails.
New template in the wizard shows an error that begins “availableVariables: {{contact_name}} is not a template placeholder”The guided template setup sends placeholder names the product no longer acceptsClose it, create the template with Add Template on the Templates tab, then pick it in the rule.
“The fallback team could not be saved. Try again.”You lack the Channel Routing permissions, or the service was briefly unavailableAsk an Owner or Admin, or try again.
A row shows Unknown source, Unknown Team or Unknown FlowWhat the rule names was removedEdit or delete the rule (see Editing, Switching Off and Deleting).
“Failed to load email routing rules. Please try again.”You lack the Email permissions, or the service was briefly unavailableReload the page; if it persists, ask an Owner or Admin to check your permissions.
A team cannot be deletedA rule, or the fallback team, sends it emailPoint the rule or the fallback at another team first.

FAQ

Two rules match the same message. Which one wins?

The one with the lower priority number. At equal priority, a rule for that specific mailbox or forwarding address wins over an All inbound email rule, and then the older rule wins.

Does a reply from the customer get routed again?

No. Rules are tried only for the first message of a conversation. Replies join the existing ticket.

Can I use regular expressions?

No. * is the only wildcard, and every other character is matched as written.

Why did a rule for support@ match mail sent to support+orders@?

Plus-tags are ignored when matching, so support+orders@example.com also counts as support@example.com.

Why did my CC rule not match?

CC entries are matched only against the CC line, and a rule with a CC entry never matches a message without one.

The rule matched but the sender got no acknowledgement. Why?

Check four things: that the rule names a template (open it with the pencil icon; Default template sends nothing on a rule that never had a template); that you have a connected mailbox that can send; that the message started a new conversation rather than replying to one; and that it was not automatic mail such as an out-of-office reply.