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
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 unreadableDateTry
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
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…Yes
severity to Resolved.Change severity to Resolved.Else if @alertText contains "critical" (ignoring case) or @…
severity to Critical.Change severity to Critical.Else if @alertText contains "error" (ignoring case) or @ale…
severity to Error.Change severity to Error.Else if @alertText contains "warn" (ignoring case) or @aler…
severity to Warning.Change severity to Warning.Otherwise
No steps
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 sheetErrorTry
sheetTabName in alertSheetUrl. Save it as logged.Add a row to sheetTabName in alertSheetUrl. Save it as logged.On error
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 pingErrorTry
pinged.Send a message. Save it as pinged.severity alert: subject
From sender
Sent sentAt
sheetNoteOn error
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.failures isn't emptyIf failures isn't emptyYes
failures 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.No
No steps
labelErrorIf a step below fails, save the error as labelErrorTry
filedLabel to email email. Save it as labelled.Add label filedLabel to email email. Save it as labelled.On error
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).