Turns each new alert email into a row in your spreadsheet and a Telegram message, and never logs the same alert twice.
Uses
Gmail
Google Sheets
Telegram
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.
email.When an email arrives. Save it as email.alertSheetUrl to blank.Set alertSheetUrl to blank.sheetTabName to Alerts.Set sheetTabName to Alerts.filedLabel to Alert logged.Set filedLabel to Alert logged.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.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.(?:<(?:style|script)\b[^>]*>[\s\S]*?</(?:style|script)>|<[^>]+>| |\s)+ with in email.body (ignoring case) and save it as bodyText.Replace the pattern (?:<(?:style|script)\b[^>]*>[\s\S]*?</(?:style|script)>|<[^>]+>| |\s)+ with in email.body (ignoring case) and save it as bodyText.bodyText back from HTML and save it as plainText.Make bodyText back from HTML and save it as plainText.plainText and save it as excerptText.Trim plainText and save it as excerptText.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.sentAt to blank.Set sentAt to blank.unreadableDateIf a step below fails, save the error as unreadableDateemail.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.filedAt.Get the current date and time and save it as filedAt.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.alertText to subject excerpt.Set alertText to subject excerpt.severity to Info.Set severity to Info.subject contains resolved (ignoring case) or subject contains recovered…If subject contains resolved (ignoring case) or subject contains recovered…severity to Resolved.Change severity to Resolved.severity to Critical.Change severity to Critical.severity to Error.Change severity to Error.severity to Warning.Change severity to Warning.failures to an empty list.Set failures to an empty list.sheetNote to Logged to your alert sheet..Set sheetNote to Logged to your alert sheet..sheetErrorIf a step below fails, save the error as sheetErrorsheetTabName in alertSheetUrl. Save it as logged.Add a row to sheetTabName in alertSheetUrl. Save it as logged.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.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..pingErrorIf a step below fails, save the error as pingErrorpinged.Send a message. Save it as pinged.severity alert: subject
From sender
Sent sentAt
sheetNotepingError.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.failures isn't emptyIf failures isn't emptyfailures with ; and and save it as failureList.Join failures with ; and and save it as failureList.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.labelErrorIf a step below fails, save the error as labelErrorfiledLabel to email email. Save it as labelled.Add label filedLabel to email email. Save it as labelled.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).