Key Concepts#
To fully leverage MailTrigger’s capabilities, it’s important to understand four foundational concepts: Mailbox, Rule, Action, and Route.
These components work together to determine how emails are received, evaluated, and acted upon. You can think of them as building blocks for automating your email-based workflows.
Mailbox#
A Mailbox is a MailTrigger-managed email account that can send and/or receive messages.
You define one or more mailboxes under a verified domain (e.g. alerts@example.com
, hr@example.com
), and each mailbox can have its own set of routes.
Mailboxes serve as the entry point for all routing logic.
Note
A mailbox can also be used as the login identity when sending emails via SMTP. For example, when you send an email to trigger a route, you’ll typically log in using your mailbox address and credentials.
Rules – When should something happen?#
A Rule is a condition that determines whether a Route should activate for a given email.
Rules act like filters. You can define conditions based on:
Sender address
Subject line content
Body keywords
Custom headers
Attachment presence or type
For example, you might define:
A rule that matches if the sender is from a trusted domain
A rule that activates only if the subject contains the word urgent
Multiple rules can be combined to create precise match conditions.
Supported Rule Types#
When configuring a rule, you can choose from the following rule types:
Matches Regex – Activates only when a regular expression pattern is matched.
Does Not Match Regex – Activates when the value does not match a given regex.
Includes Text – Triggers if the value contains the specified keyword.
Excludes Text – Triggers if the value does not contain the specified keyword.
LLM Prompt – Triggers based on AI evaluation using your custom prompt.
JavaScript Code – Runs custom JavaScript logic to decide whether to trigger the rule.
Actions – What should happen next?#
An Action defines what MailTrigger should do when a route is triggered.
Each action performs a specific task, such as:
Forwarding the email to another address
Calling an external API (webhook)
Sending a chat message (Telegram, Slack, etc.)
Running an AI prompt with an LLM
Editing email content using custom JavaScript
You can configure one or more actions per route to create flexible workflows.
Note
For a complete list of supported actions, their configuration options, and usage details, see the Integrations section.
Routes – The pipeline that connects rules to actions#
A Route ties everything together. It connects one or more Rules to one or more Actions.
Here’s how a route works:
When a mailbox receives an email, MailTrigger checks each route assigned to that mailbox.
If the route’s rules are matched, the route is activated.
The route then runs its configured actions.
Routes also define how actions are executed:
Sequential – actions run one after another
Parallel – all actions run at the same time
You can also configure whether the system should continue checking other routes after a match is found (using the “Pass to Next” option).
Example Scenario (Illustrative)#
Let’s say you want to:
Detect emails whose subject contains the word invoice
Forward those emails to your accounting system via SMTP
Send a real-time alert to a team chat
To do this in MailTrigger:
You’d create a rule that checks if the subject contains invoice.
You’d define two actions: - Forward the message via SMTP - Send a chat notification via Telegram
You’d connect them together in a route, assign it to your mailbox, and set the execution to parallel.
This model—Mailboxes, Rules, Actions, and Routes—gives you full control over how emails are handled and automated.