How to Set Up Smart Email Filters and Auto-Replies That Actually Work
Automate10 min read·March 15, 2026·--

How to Set Up Smart Email Filters and Auto-Replies That Actually Work

Most auto-replies are useless. Here's how to build intelligent email filters and AI-powered responses that route, categorise, and answer emails — cutting your inbox time by 70%.

@
@kivorablog
March 15, 2026
Share

The Inbox Problem


You get 50–100 emails per day. Half are spam, a quarter need replies, and the rest are FYIs you'll never read. You spend 2–3 hours daily in your inbox, and still miss important messages.


For a Nigerian business owner billing ₦10,000/hour, that's ₦20,000–₦30,000/day in email management. Monthly? ₦600,000 of your time spent reading and replying.


Smart filters and AI auto-replies can cut that by 70%. Here's how.


What Smart Email Automation Handles


Email TypeVolumeCurrent HandlingAutomated
Customer support15/dayManual replyAI auto-response
Sales inquiries8/dayManual qualificationAI pre-qualify + schedule
Invoice/payment queries5/dayManual check + replyAuto-lookup + reply
Newsletter/product updates20/dayRead or deleteAuto-archive, weekly digest
Meeting requests4/dayBack-and-forthCalendar link auto-reply
Spam / cold outreach15/dayDeleteAuto-archive



Gmail Native Filters (Start Here)


Before adding AI, set up Gmail's built-in filters. These handle 60% of the problem for free.


Essential Filter Setup


Go to Gmail → Settings → Filters and Blocked Addresses → Create a new filter.


Filter PurposeFromSubject ContainsAction
Auto-archive newsletters*news@, *noreply@, *updates@Skip Inbox, label "Newsletters"
Flag payment emailspaystack.com, flutterwave.compayment, receiptLabel "Payments", Star it
Priority client emails@clientdomain.comLabel "VIP", Star it
Auto-delete spam patternsunsubscribe, limited offerDelete it
Meeting invitescalendar.google.com, calendly.comLabel "Meetings"

Create Filters via Google Apps Script


For bulk filter creation:


function createGmailFilters() {
  const filters = [
    { from: 'noreply@', action: 'archive', label: 'Automated' },
    { from: 'news@', action: 'archive', label: 'Newsletters' },
    { from: '@paystack.com', action: 'label', label: 'Payments' },
    { subject: 'invoice', action: 'star', label: 'Invoices' }
  ];

  // Gmail API filter creation
  filters.forEach(f => {
    Gmail.Users.Settings.Filters.create({
      criteria: { from: f.from, query: f.subject ? 'subject:' + f.subject : '' },
      action: { addLabelIds: [getLabelId(f.label)], removeLabelIds: ['INBOX'] }
    }, 'me');
  });
}



AI-Powered Auto-Replies


Gmail's canned responses are static. AI auto-replies understand context and generate relevant responses.


Architecture: Gmail → n8n → Groq → Gmail


New Email Arrives
  → Gmail forwards to n8n webhook
  → n8n extracts sender, subject, body
  → Groq classifies intent (support / sales / billing / other)
  → Groq generates appropriate reply
  → n8n sends draft reply via Gmail API
  → You review and approve (or auto-send for confidence > 90%)

The Classification Prompt


const classifyPrompt = `Classify this email into one category:

support — customer needs help with a product issue
sales — someone wants to buy or learn about pricing
billing — question about invoice, payment, or refund
meeting — requesting or confirming a meeting
spam — unsolicited cold outreach
other — anything else

Email from: ${sender}
Subject: ${subject}
Body: ${body.substring(0, 500)}

Reply with ONLY the category name.`;

The Auto-Reply Prompt


const replyPrompt = `You are the customer support agent for a Nigerian tech company.

A customer sent this email:
Subject: ${subject}
Body: ${body}

Write a professional, warm reply that:
1. Acknowledges their concern
2. Provides a helpful next step or answer
3. Includes relevant links if applicable
4. Is under 150 words
5. Signs off as "The [Company] Team"

Do NOT make up specific product details you don't know.`;



Smart Routing Rules


Based on classification, route emails differently:


ClassificationAuto-ActionHuman Review?
Support (FAQ)AI auto-replyNo (confidence >90%)
Support (complex)AI draft replyYes — draft in Gmail
SalesAI pre-qualify + send pricingYes — lead in CRM
BillingAuto-lookup payment status + replyNo (if data available)
MeetingReply with Calendly linkNo
SpamAuto-archiveNo
OtherForward to youYes



Setting Up Gmail Forwarding to n8n


  • In Gmail Settings → Forwarding, add your n8n webhook URL
  • Create a filter: "Only forward emails that match these criteria"
  • Set criteria: exclude newsletters, spam, and automated emails
  • n8n receives the email as a webhook payload

n8n Webhook Handler

// n8n Webhook Node configuration
{
  "path": "/gmail-webhook",
  "method": "POST",
  "responseMode": "lastNode"
}

// Function Node — process incoming email
const email = $input.first().json;
const classification = await classifyEmail(email);

if (classification.confidence > 0.9 && classification.category !== 'other') {
  // Auto-reply
  const reply = await generateReply(email, classification);
  await sendGmailReply(email, reply);
  return { json: { status: 'auto-replied', category: classification.category } };
} else {
  // Draft for human review
  const draft = await generateReply(email, classification);
  await createGmailDraft(email, draft);
  await sendSlackAlert(email, classification);
  return { json: { status: 'drafted', category: classification.category } };
}

Email Tool Comparison

ToolAuto-ClassifyAI ReplyCostAfrican Market Fit
Gmail + n8n + GroqYesYes₦0Excellent
SuperhumanBasicNo₦40,000/monthOverpriced
SaneBoxYesNo₦10,000/monthGood for filtering
MissiveBasicNo₦0–₦18,000Good for teams
FrontYesNo₦24,000/monthGood for shared inboxes

Common Mistakes

MistakeResultFix
Auto-replying to everythingEmbarrassing AI responsesOnly auto-reply when confidence >90%
No sender whitelistClients get AI replies instead of youAdd VIP senders to a bypass list
Forgetting to check draftsImportant emails sit in draftsDaily Slack summary of pending drafts
Too many filtersImportant emails get misroutedStart with 5 filters, add carefully
AI making up factsWrong prices, fake featuresAdd "do not fabricate" to all prompts

After 2 weeks of running this system, most users report checking email only twice daily — morning and evening — instead of constantly. That's 2+ hours reclaimed every day.

Read more on Kivora Blog

Read more on Kivora Blog

Get started →