Documentation

✉️ Email Delivery

Documentation, reference material and tutorials for CRM-NG SMTP Email: setup guides for every mail service, troubleshooting, and one article per error message.

Smart routing

Updated

By Duane GarnerChief Executive Officer (CEO)
Summarize: Claude ChatGPT View Markdown
On this page

Send chosen emails through your backup SMTP server, based on who they are to or what the subject says, while everything else uses your main mailer.

Smart routing lets you pick out certain emails and send them through your backup SMTP server instead of your main mailer, every time. You choose them by recipient or by subject. This article explains how the rules work and their limits. It is for site owners who need one kind of email to leave by a different route, for example internal notices to staff or messages to one demanding domain.

Before you start

Smart routing reuses the Backup SMTP Transport settings on the Alerts tab. Set those up first. See Backup SMTP transport.

Routing only works when all three are true:

  • Enable rule-based routing is ticked,
  • the backup transport is Enabled,
  • an SMTP host is filled in for the backup.

If any is missing, every email simply uses your main mailer.

Set up a rule

  1. Open the Smart Routing tab

    Go to CRM-NG SMTP → Settings → Smart Routing. The heading reads Smart SMTP Routing.

  2. Switch routing on

    Tick Enable rule-based routing next to Routing.

  3. Add a recipient rule

    In Recipient contains, type text to look for in the recipients, for example @example.com.

  4. Add a subject rule

    In Subject contains, type text to look for in the subject, for example [Staff].

  5. Save

    Press Save Routing Rules.

You can fill in one box or both. Leave a box empty to turn that rule off.

How matching works

The screen says: A message uses the backup SMTP transport when either non-empty rule matches.

  • Either rule is enough. If the recipient rule matches or the subject rule matches, the email is routed. Both do not need to match.
  • Contains means anywhere. The text can appear at the start, middle or end.
  • Case does not matter. [staff] matches [Staff] and [STAFF].
  • Recipients means the To addresses. CC and BCC addresses are not checked.
  • One value per box. Each box holds one piece of text. You cannot list several domains in one box.

Examples

Recipient contains Subject contains Routed
@example.com (empty) Any email with a To address at example.com
(empty) invoice Any email whose subject includes "invoice", "Invoice #22" and so on
@example.com invoice Emails to example.com, and also any email about an invoice
ops@ (empty) Emails to any address beginning with "ops@", on any domain

Be specific

Short text matches more than you expect. A subject rule of order also catches "Reorder reminder" and "Border crossing update". Use the most specific text you can.

Which mailers routing affects

The screen also says: API mailers continue using their primary provider.

Routing works by changing the SMTP server for the message as it is prepared. That only has an effect when your main mailer sends through the standard WordPress mail engine, such as Other SMTP or Default (none). API mailers (SendGrid, Brevo, Postmark, Amazon SES, Google / Gmail, 365 / Outlook and the rest) send through their own connection and ignore the change, so routing does nothing for them. Zoho Mail also sets its own server when it sends.

If your main mailer is an API mailer and you need a different route for some emails, that is not something routing can do in this version.

See routed emails in the log

Routed emails show smtp-backup-route in the Mailer column of the Email Log. That makes it easy to check your rules catch what you intended, and nothing else.

Good to know

  • Routing only applies while CRM-NG SMTP is the plugin sending your site's email.
  • The From address must be allowed by the backup provider, or routed emails will fail there.
  • Test emails from Tools → Email Test are ordinary messages for routing purposes. If the test address or subject matches a rule, the test goes through the backup.
Go to Top