Notifications: alerts by email and channels
On this page
Notifications: alerts by email and channels
With BoxLang+, BxLens can send you an email, or a message in Slack, Microsoft Teams or Telegram, or a signed webhook call, when something is wrong, before your users call. Seventeen alerts watch the JVM, disks, errors, traffic, databases, tasks, dependencies, mail, AI, security and the logs. Every alert is off until you switch it on, one by one.
Set it up in Settings, Notifications (admin only). When an alert fires, the alert runbook says what each one means and what to check first. For more than one server, read Several servers.
Set up in 5 steps
| Step | What you do | Where |
|---|---|---|
| 1. Say how mail is sent | Give the SMTP server, login and sender | Settings, Notifications |
| 2. Say who gets mail | Add people, severity, categories and reports | Settings, Notifications |
| 3. Switch alerts on | Turn on the alerts you want and set their limits | Settings, Notifications |
| 4. Add channels | Add Slack, Teams, Telegram or a webhook | Settings, Notifications, Channels |
| 5. See the mails before they go out | Check each mail with sample data | Settings, Notifications, Mail previews |
Also on this page: How the mails are sent, Set it up with Lensy, Safety and Without BoxLang+.
1. Say how mail is sent
Lens sends the mails itself over SMTP. It does not use bx-mail, so an alert can still reach you when the application, or its mail module, is the thing that is broken.
| Setting | Meaning |
|---|---|
| Server, port, security | Your SMTP server. TLS 1.2 and 1.3, and the server name is checked. |
| User | Empty when the relay needs no login. |
| Password | Write only. Press Set or Replace and paste it. Clear removes it. See below. |
| From, name, reply to | Who the mail is from. |
Security has three options:
Port 587 usually.
Port 465.
A trusted relay only.
The password
Press Set or Replace and paste it: it goes to the server, is kept sealed in the Secret Store and is never shown again. The page says where it comes from (set in console, from boxlang.json, from the environment).
The order is:
- The one set in the console.
notifications.smtp.passwordas abxsecret:value inboxlang.json.- The environment variable whose name you type in the field.
If you change the server while a password is set, the page asks you to confirm that the password goes to the new host. Nothing sends a password to another host by itself.
Press Send test mail to see the answer of your SMTP server in plain words. The test mail and the report buttons wait a few seconds between two calls and stop at 20 an hour.
2. Say who gets mail
Add people with an address and a name. For each person you choose:
- whether they get alerts at all,
- the lowest severity (warnings and critical, or critical only),
- the categories (none means all): availability, jvm, capacity, errors, traffic, database, runtime, tasks, dependencies, mail, ai, security, logs,
- which reports they get (daily, weekly, monthly), see Email reports.
At most 50 people. An address cannot carry a line break or a list of addresses.
3. Switch alerts on
| Alert | Fires when | Default limits |
|---|---|---|
| Server down (critical) | A server stops saving its health snapshot and heartbeat | 3 minutes |
| Deadlock (critical) | The JVM reports threads that wait for each other | |
| Heap pressure (critical) | The heap stays above a limit, or GC uses too much time | 90% for 5 minutes, or GC above 30% |
| Disk space (critical) | A volume is nearly full, or a folder Lens must write to is read only | 90% used |
| Error spike (critical) | Many errors a minute, an error never seen before, or a resolved error that came back | 20 a minute over 5 minutes, new error on, regressed on. Ignored errors never fire |
| Failed requests (critical) | The share of failed requests (a 5xx or an uncaught error) is high | 5% of at least 50 requests over 5 minutes |
| Slow site (warning) | The average response time stays high | 2000 ms for 10 minutes, at least 50 requests |
| Datasource pool (critical) | Requests wait for a database connection | 2 minutes |
| Executor saturated (warning) | An executor is critical or has a long queue | 100 queued tasks |
| Scheduled task failing (warning) | A task is failing | 2 failures |
| Outgoing HTTP (warning) | A host the app calls fails more than the HTTP page limit | |
| Mail (warning) | Bounces, a high failure rate, a spool that does not drain (Mail integration) | |
| AI (warning) | Failed runs, rate limits, or a cost over your daily budget (AI integration) | budget off |
| MCP rate limited (warning) | A hosted MCP server blocks many calls with its rate limit, usually one client flooding it | 30 blocked in 10 minutes (collectors.aiobs.mcpRateLimited) |
| MCP rate limiter failing (critical) | The store of a rate limit failed, so with failOpen the server is not limited | any failure in 10 minutes |
| Security (critical) | Repeated failed console logins, or a change of settings | 5 failures over 5 minutes |
| Errors in the logs (warning) | Many ERROR lines in the BoxLang logs | 10 a minute over 5 minutes |
You can change the severity, every limit, and how often a mail repeats while the alert stays true (default 60 minutes).
4. Add channels
A channel is a place that is not a mailbox: a Slack channel, a Microsoft Teams channel, a Telegram chat or your own webhook. Open Settings, Notifications, Channels and press + Add channel.

Pick the type. Each tab has the same three parts: what you need, how to set it up, what a message contains. Text from your servers is cleaned of secrets and escaped for each format, so a message cannot mention a Slack channel, make a link or carry a script.
What you need
An incoming webhook address on hooks.slack.com.
How to set it up
- Follow Alerts in Slack.
- Add the channel and paste the webhook address as its secret (see the settings below).
- Press Send test.
What a message contains
- The message kinds in What a channel gets.
- At most 40 KB. A longer text is cut with three dots.
- Text is escaped for Slack:
&,<,>.
What you need
A Workflows webhook address that posts an Adaptive Card. The host must be *.logic.azure.com, *.webhook.office.com or *.powerplatform.com.
How to set it up
- Follow Alerts in Microsoft Teams.
- Add the channel and paste the webhook address as its secret (see the settings below).
- Press Send test.
What a message contains
- The message kinds in What a channel gets.
- At most 28 KB. A longer text is cut with three dots.
- Text is escaped for Teams: Markdown characters and
<,>.
What you need
A bot token from BotFather and a chat id. The host is api.telegram.org.
How to set it up
- Follow Alerts in Telegram.
- Add the channel with the chat id and paste the bot token as its secret (see the settings below).
- Press Send test.
What a message contains
- The message kinds in What a channel gets.
- At most 4096 characters. A longer text is cut with three dots.
- Text is escaped for Telegram HTML:
&,<,>.
What you need
An https address of yours; JSON signed with a key. Any public host is allowed.
How to set it up
- Follow Alerts to a webhook.
- Add the channel and paste the signing key as its secret (see the settings below).
- Press Send test.
What a message contains
- The message kinds in What a channel gets.
- At most 64 KB. A longer text is cut with three dots.
- The message is JSON.
For each channel you choose:
- a name (1 to 60 characters) and whether it is on. A channel that is off sends nothing, but Send test still works,
- the alerts that go there: every alert, or the ones you tick (none is allowed, for a channel that only gets reports),
- the lowest severity: warnings and critical, or critical only,
- the reports that go there: daily, weekly, monthly. None by default,
- the secret: the webhook address, the bot token, or the signing key of a webhook. It is write only: you paste it, BxLens keeps it encrypted in the Secret Store, and nothing ever shows it again. The list shows
set,signedand the host of the address, never the address. To change it, paste a new one; to keep it, leave the field empty.
At most 20 channels. The settings of a channel (name, type, rules, severity, chat id, switch) are saved with the other notification settings and reach every server. The secret is on the volume of the Secret Store: servers that should send must share secrets.dir (and the key), as the guide of the store explains, because the elected sender is the one that posts.
What a channel gets
The same elected sender that sends the mail also serves the channels, from the same alerts and the same rules (the switch, the pause, the repeat time of each alert, maxPerHour). A channel gets one message for each alert:
| Message | When |
|---|---|
| Firing | An alert that this channel has not been told yet is true. |
| Reminder | The alert is still true after the repeat time of its rule. |
| Resolved | The alert stopped, or you took it off the channel. It says how long it lasted. |
| Report | The daily, weekly or monthly report, for the channels that list it. The title, the key numbers and a link. |
A message goes to a channel when the channel is on, the alert is one of its alerts (or it has all alerts), and the severity reaches its lowest severity. A message has a link, Open in BxLens, only when the setting console.publicUrl is set.
The last result of each channel (when, and the answer in plain words) is on the list. A failure that cannot be fixed by waiting (a 404, a removed webhook, a token that was revoked) says so, and the channel keeps trying every five minutes until you fix it or switch it off.
Safe by design
5. See the mails before they go out: Mail previews
Settings, Notifications, Mail previews shows the exact mail of each of the 21 alerts and of the daily, weekly and monthly report.

- The list on the left has the alerts (with their severity) and the reports. An alert is always shown with sample numbers (the page says "Sample data"). A report is built from your saved data when there is some, and from sample data otherwise.
- Firing, Reminder, Resolved switch the state of an alert. HTML and Plain text switch the two parts of the mail. Dark mode turns the dark palette on or off in the preview, whatever your system prefers.
- The HTML is shown in a frame with no scripts and no network (
sandbox), and the page only puts it into the frame. The subject is shown under it.
Send me this sends the mail to one address that you type, and only to that one, never to the recipients. The subject and the body say TEST. It is limited like the test mail (5 seconds between two, 20 an hour, shared with it), needs the CSRF token and BoxLang+, is refused when console.readOnly is on, and is audited as mail.preview.send with the alert or report, its state and the address. There is no "send to all recipients" here.
How the mails are sent
- Every server evaluates its own alerts and lists them in its health snapshot.
- An alert sends a firing mail once, a reminder every repeat time while it stays true, and a resolved mail when it stops.
- One mail per person carries every event of that minute that the person asked for, so a bad minute is one mail and not forty.
- Pause 1 hour, Pause 1 day and the main switch stop everything at once.
- At most
maxPerHourmails an hour (30). A round stops sending after 90 seconds and the rest goes in the next one, and the page never waits for the mail server.
Set it up with Lensy
Ask Lensy in plain words, for example:
- "Email ops@acme.com when any disk is above 85 percent."
- "Tell me every morning at 8 how the servers did." (a recipient, the daily report, a time)
- "Alert the team when mail bounces more than ten times an hour."
- "Pause notifications for two hours."
Lensy first reads what is set (alertRules, notifications), then proposes one change per step: alertRuleSet (an alert and its limits), recipientSet, recipientRemove, reportSchedule, notificationsSet. Each one shows an approval card that says in words what it will do. For a recipient the card names the address and reminds you that anyone who can read that mailbox will see what is sent there. Nothing is saved until the admin clicks Approve, and a denied card changes nothing.
For channels Lensy has two tools: channels (names, types, switches, alerts, last result; never an address, a token or a key) and channelTest (send the test message to a channel you name, after your approval). It cannot create a channel, change where one posts, or read or change a secret.
Lensy can pick only an alert from the catalog above and only limits inside the allowed range. It cannot change the SMTP server, user or password, so it can never send your alerts somewhere else, and it has no tool to write free text into a mail. It is told to use only an address that you gave it in the chat. These tools are for the admin role, BoxLang+, and are refused when the console is read only or ai.actions is off. See the tool list.
Safety
- Admin only. A viewer gets 403 and never sees the tab.
- Every change is audited (
notifications.*), without the password. Channels are audited aschannel.changeandchannel.testwith the id and type only. - Refused when
console.readOnlyis on (the test mail is not a change). - The SMTP address is chosen by an admin. Lens connects to it and nowhere else. Channels connect only to the https addresses the admin saved, after the checks above.
Without BoxLang+
The tab shows what it offers and a BoxLang+ note, and the Channels tab is locked the same way. The server answers 403 for every route, including notifications/channels.