Multi-Account Email Classifier with AI, Gmail, Discord & Google Sheets
AI Email Classifier π¬
Automate Email Classification, Prioritization, and Spam Detection Across Multiple Accounts
Created by: Jayant Kumar (@jharilela)
π Powered by: Gmail, Google Sheets, OpenAI, Discord, and n8n
Sample Discord labelling as Spam
Sample Discord labelling as Legit
Why I Built This
Focus is Expensive. Managing multiple email inboxes every dayβpersonal, business, partnerships, invoices. Logging into each, skimming through noise, flagging important stuff, and deleting spam started eating up hours of my week. I needed a system that helped me focus only on what matters without building an entire helpdesk dashboard.
I already live in Discord. It made sense to push my emails thereβbut in a fun, digestible, and actionable way. I built AI Email Classifier π¬ to summarize emails, detect spam, assign priority, and make everything skimmable with pictures and links.
And it works across multiple Gmail accounts.
Key Features
β
Works with multiple Gmail inboxes
π§ Uses AI to classify spam vs legit
π― Assigns priority levels: High / Medium / Low
π Appends everything to a central Google Sheet
πΈ Sends visual summaries to Discord (with image + action links)
π Powered by open-source: n8n_discord_trigger_bot
How It Works
Hereβs the high-level flow:
New Email in any inbox triggers the worfklow to start
The AI Agent reads the raw content, subject, sender, Gmail labels.
It calls a Google Sheet that acts as our feedback memory:
Emails and domains manually marked as spam or legit.
AI classifies the incoming email using logic:
Spam if sender or domain is blacklisted, or content matches patterns like:
"promotions, phishing, ads, mass emails, cold offers"
Priority is assigned by:
High: deadlines, legal, payments, clients, CEO emails
Medium: team updates, meetings, project notifications
Low: newsletters, FYIs, casual threads
It produces a compact JSON output with:
Sender, recipient, subject, summary, priority, priority color, image URL, action URL
The message is formatted visually and posted back to Discord as an embed with:
Summary text
Actionable links
Priority color code
Thumbnail (if any)
Google Sheet Training Table
The system uses this sheet as live memory to label spam and legit senders:
ββββββββββββββββββββββ¦βββββββββββββββ¦ββββββββββββββββββ¦βββββββββββββββ¦βββββββββββββββββ β Email β Domain β Classification β Labelled By β Labelled Date β β βββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββ£ β offers@badsite.com β badsite.com β Spam β Jayant β 08/07/2025 β β ceo@trusted.com β trusted.com β Legit β Jayant β 08/07/2025 β ββββββββββββββββββββββ©βββββββββββββββ©ββββββββββββββββββ©βββββββββββββββ©βββββββββββββββββ
This allows manual control to teach the AI which senders to trust or ignore. Every time I see something marked wrong, I just reply in Discord with "spam" or "legit" on that message thread. That triggers an update to the Sheet via AI parsing and n8n.
Why Manual Input Still Matters
AI isnβt perfect.
Some spam emails are cleverly disguised. And some senders are contextually important only to you.
Thatβs why I kept a simple feedback loop: You tell the bot "spam" or "legit" on any Discord email message. Or anything along that line The AI agent detects the intent and updates the Sheet. The AI improves its judgment next time as it now remembers your preference
Why Discord?
Because Slack charges per seat and email feels lonely.
I run most of my operations inside Discord community chats, client rooms, bot alerts.
Instead of making a full email UI, I turned each email into a Discord card with a thumbnail, summary, and quick actions.
Itβs fun. Itβs visual. It doesnβt feel like work.
Email becomes more like a game feed.
Tech Stack
Gmail β Discord via Gmail trigger node
Discord β n8n Webhook via n8n_discord_trigger_bot
OpenAI GPT-4o (classification + summarization)
Google Sheets (feedback memory)
Discord Node (embed output with JSON + images)
Try It Yourself
Clone the workflow JSON, set up your Gmail integrations, and install the n8n Discord Trigger Bot.
I made this workaround because i couldnt find a discord trigger on n8n.
Now I just scroll my Discord DMs and know what to reply to, and ignore everything else.Dont let Email spam your brain. Let your AI do the thinking.
Related Templates
Instagram Full Profile Scraper with Apify and Google Sheets
πΈ Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Technology News Workflow Explanation with Key Services
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Auto-Publish Techn...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments