Turns each new alert email into a row in your spreadsheet and a Telegram message, and never logs the same alert twice.

UsesGmailGoogle SheetsTelegram

Log alert emails to a sheet and ping Telegram

Each alert email that arrives in Gmail from the sender you name becomes one row in your spreadsheet and one short Telegram message, as it lands. The row records when the alert was sent, how severe it is, the sender, the subject, a short excerpt and the Gmail message id. Severity is read from the alert's own words: a subject saying resolved or recovered is marked Resolved, otherwise critical, error or warning wording sets the level, and anything else is Info. The Telegram message carries the severity, subject, sender and time but not the excerpt, so the contents of your mail stay out of the chat.

Every alert is handled once, by its own run. Only after both the row and the Telegram message have gone out is the email labeled 'Alert logged'. If either one fails, for example because the tab name is wrong or the bot was removed from the chat, the run is marked as failed, says which part did not happen, and the email is left without the label so you can find it in Gmail.

You need Gmail, Google Sheets and Telegram connected; the address your alerts come from in the trigger's From field; a link to your spreadsheet, with an 'Alerts' tab headed in that column order; and the chat to ping, picked in the Telegram step.

GmailGmailWhen an email arrives. Save it as email.When an email arrives. Save it as email.
Set alertSheetUrl to blank.Set alertSheetUrl to blank.
Set sheetTabName to “Alerts”.Set sheetTabName to “Alerts”.
Set filedLabel to “Alert logged”.Set filedLabel to “Alert logged”.
Use email.subject, or “(no subject)” if it is empty and save it as subject.Use email.subject, or “(no subject)” if it is empty and save it as subject.
Use email.from, or “(unknown sender)” if it is empty and save it as sender.Use email.from, or “(unknown sender)” if it is empty and save it as sender.
Replace the pattern “(?:<(?:style|script)\b[^>]*>[\s\S]*?</(?:style|script)>|<[^>]+>|&nbsp;|\s)+” with “ ” in email.body (ignoring case) and save it as bodyText.Replace the pattern “(?:<(?:style|script)\b[^>]*>[\s\S]*?</(?:style|script)>|<[^>]+>|&nbsp;|\s)+” with “ ” in email.body (ignoring case) and save it as bodyText.
Make bodyText back from HTML and save it as plainText.Make bodyText back from HTML and save it as plainText.
Trim plainText and save it as excerptText.Trim plainText and save it as excerptText.
Shorten excerptText to 200 characters (keeping words whole) and save it as excerpt.Shorten excerptText to 200 characters (keeping words whole) and save it as excerpt.
Set sentAt to blank.Set sentAt to blank.
If a step below fails, save the error as unreadableDateIf a step below fails, save the error as unreadableDate
Try
Make email.date readable as “2026-11-02 14:05” and save it as sentAt.Make email.date readable as “2026-11-02 14:05” and save it as sentAt.
On error
Get the current date and time and save it as filedAt.Get the current date and time and save it as filedAt.
Make filedAt readable as “2026-11-02 14:05” and save it as sentAt.Make filedAt readable as “2026-11-02 14:05” and save it as sentAt.
Set alertText to “@subject excerpt”.Set alertText to “@subject excerpt”.
Set severity to “Info”.Set severity to “Info”.
If subject contains “resolved” (ignoring case) or subject contains “recovered”…If subject contains “resolved” (ignoring case) or subject contains “recovered”…
Yes
Change severity to “Resolved”.Change severity to “Resolved”.
Else if @alertText contains "critical" (ignoring case) or @…
Change severity to “Critical”.Change severity to “Critical”.
Else if @alertText contains "error" (ignoring case) or @ale…
Change severity to “Error”.Change severity to “Error”.
Else if @alertText contains "warn" (ignoring case) or @aler…
Change severity to “Warning”.Change severity to “Warning”.
Otherwise
No steps
Set failures to an empty list.Set failures to an empty list.
Set sheetNote to “Logged to your alert sheet.”.Set sheetNote to “Logged to your alert sheet.”.
If a step below fails, save the error as sheetErrorIf a step below fails, save the error as sheetError
Try
Google SheetsGoogle SheetsAdd a row to sheetTabName in alertSheetUrl. Save it as logged.Add a row to sheetTabName in alertSheetUrl. Save it as logged.
On error
Add its row could not be added to the '@sheetTabName' tab of your alert spreadsheet (sheetError.message) to the end of failures and save it as failures.Add its row could not be added to the '@sheetTabName' tab of your alert spreadsheet (sheetError.message) to the end of failures and save it as failures.
Change sheetNote to “Not logged: your alert sheet could not be written to. See the failed run in Lodol.”.Change sheetNote to “Not logged: your alert sheet could not be written to. See the failed run in Lodol.”.
If a step below fails, save the error as pingErrorIf a step below fails, save the error as pingError
Try
TelegramTelegramSend a message. Save it as pinged.Send a message. Save it as pinged.severity alert: subject From sender Sent sentAt sheetNote
On error
Add the Telegram message could not be sent - check the chat picked in the Telegram step (pingError.message) to the end of failures and save it as failures.Add the Telegram message could not be sent - check the chat picked in the Telegram step (pingError.message) to the end of failures and save it as failures.
If failures isn't emptyIf failures isn't empty
Yes
Join failures with “; and ” and save it as failureList.Join failures with “; and ” and save it as failureList.
Stop and report a problem: The alert '@subject' was not fully handled: failureList. It was left without the '@filedLabel' label, so you can find it in Gmail.Stop and report a problem: The alert '@subject' was not fully handled: failureList. It was left without the '@filedLabel' label, so you can find it in Gmail.
No
No steps
If a step below fails, save the error as labelErrorIf a step below fails, save the error as labelError
Try
GmailGmailAdd label filedLabel to email email. Save it as labelled.Add label filedLabel to email email. Save it as labelled.
On error
Stop and report a problem: The alert '@subject' was logged and sent to Telegram, but the '@filedLabel' label could not be added to it in Gmail (labelError.message).Stop and report a problem: The alert '@subject' was logged and sent to Telegram, but the '@filedLabel' label could not be added to it in Gmail (labelError.message).