Flag VIP client emails in Zoho Mail and alert your team

By General Input

Keep a spreadsheet of your most important senders, and every email from one gets labeled, posted to your team channel, and logged automatically.

Integrations

  • Zoho Mail
  • Google Sheets
  • Slack Bot

Type

Deterministic Code

Categories

  • Sales
  • Operations

Whenever a new email arrives in Zoho Mail, check the sender against a watchlist of VIP contacts I keep in Google Sheets. If it matches, label the message, alert my account team in Slack, and log it. This should be fully deterministic: a spreadsheet lookup and a string comparison, with no AI judgement involved, so it is cheap enough to run on every inbound message.

My watchlist lives on a tab called Watchlist with a header row and three columns. Column A is the match value, which is either a full email address such as dana.reeve@acme.com or a bare company domain such as acme.com. Column B is the company name. Column C is the name of the account owner who covers that company. Read this range with the Google Sheets Get Values operation.

Match the incoming sender against the list case-insensitively. Trim whitespace and lowercase both the sender address and every watchlist value before comparing. If a watchlist value contains an @ sign, treat it as a full address and require an exact match on the sender address. Otherwise treat it as a domain and compare it against the portion of the sender address after the @ sign, ignoring a leading @ if someone typed one into the sheet. Prefer a full address match over a domain match when both are present, so a person-specific row wins over the company-wide row. If nothing matches, stop immediately and do nothing at all: no label, no Slack message, no log row.

On a match, gather what you need about the message. Zoho Mail endpoints are account scoped, so resolve the mail account id once and reuse it for every following call. Use Zoho Mail Get Email Details for the sender address, the subject line, and the received timestamp, and Zoho Mail Get Email Content for the body. Strip the HTML down to plain text and take the first 200 characters as a preview, adding an ellipsis if it was truncated.

Apply a VIP label to the message with Zoho Mail Update Emails (Batch). Zoho Mail can only apply labels that already exist, so first call List Labels and look for one named VIP, comparing case-insensitively. If it is not there, create it with Create Label and use the id that comes back. When it does already exist, reuse that label id rather than creating a duplicate.

Post an alert to my account team channel with the Slack Bot Send a Message operation. The message should contain the sender address, the matched company from column B, the named account owner from column C, the subject line, and the short body preview. Format it so the account owner's name and the company are easy to scan at a glance.

Finally, append a row to a tab called Log using the Google Sheets Append Values operation, recording the timestamp the email was received, the sender address, the subject line, and the matched account owner, in that column order. This log is what I will use later to review how quickly we respond to our most important senders.

If the Slack post or the log append fails, make sure the label was still applied, and surface the error rather than silently swallowing it.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery board