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 labelled '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.
ValuesSet alertSheetUrl to blank.Set alertSheetUrl to blank.
ValuesSet sheetTabName to Alerts.Set sheetTabName to Alerts.
ValuesSet filedLabel to Alert logged.Set filedLabel to Alert logged.
TextUse 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.
TextUse 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.
TextReplace 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.
TextMake bodyText back from HTML and save it as plainText.Make bodyText back from HTML and save it as plainText.
TextTrim plainText and save it as excerptText.Trim plainText and save it as excerptText.
TextShorten 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.
ValuesSet sentAt to blank.Set sentAt to blank.
Decisions & LoopsIf a step below fails, save the error as unreadableDateIf a step below fails, save the error as unreadableDate
Try
Dates & TimesMake 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
Dates & TimesGet the current date and time and save it as filedAt.Get the current date and time and save it as filedAt.
Dates & TimesMake 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.
ValuesSet alertText to subject excerpt.Set alertText to subject excerpt.
ValuesSet severity to Info.Set severity to Info.
Decisions & LoopsIf subject contains resolved (ignoring case) or subject contains recovered…If subject contains resolved (ignoring case) or subject contains recovered…
Yes
ValuesChange severity to Resolved.Change severity to Resolved.
Else if @alertText contains "critical" (ignoring case) or @…
ValuesChange severity to Critical.Change severity to Critical.
Else if @alertText contains "error" (ignoring case) or @ale…
ValuesChange severity to Error.Change severity to Error.
Else if @alertText contains "warn" (ignoring case) or @aler…
ValuesChange severity to Warning.Change severity to Warning.
Otherwise
No steps
ValuesSet failures to an empty list.Set failures to an empty list.
ValuesSet sheetNote to Logged to your alert sheet..Set sheetNote to Logged to your alert sheet..
Decisions & LoopsIf 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
ListsAdd 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.
ValuesChange 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..
Decisions & LoopsIf 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
ListsAdd 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.
Decisions & LoopsIf failures isn't emptyIf failures isn't empty
Yes
TextJoin failures with ; and and save it as failureList.Join failures with ; and and save it as failureList.
Decisions & LoopsStop 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
Decisions & LoopsIf 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
Decisions & LoopsStop 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).