DEV Community

Cover image for Inbox Innovation with Postmark: Presenting InboxNinja πŸ₯·
Vivek
Vivek Subscriber

Posted on

Inbox Innovation with Postmark: Presenting InboxNinja πŸ₯·

This is a submission for the Postmark Challenge: Inbox Innovators.

Ever wished your incoming support, careers, or operations emails could instantly land in your team’s Discord channels so you can notify the right people, ask for input, and triage issues collaboratively?

Email workflows are often rigid and slow. InboxNinja transforms that experience by giving teams a real-time, customizable email relay bot that plugs directly into their Discord workspace.

What I Built

InboxNinja is a real-time, self-hosted email relay bot designed for operational teams. It receives emails via Postmark, processes them through a webhook, summarizes the content, and neatly delivers it into specific Discord channels. Messages arrive organized in threads, with attachments and action buttons for instant response.

It turns inboxes from static, disconnected workflows into real-time, actionable conversations inside Discord.

Demo

Code Repository

GitHub logo vivekthedev / inboxninja

a real-time, self-hosted email relay bot

πŸ“¨ InboxNinja

A powerful, real-time email-to-Discord relay system for operational teams.
This application uses Postmark's Inbound Email Webhooks to receive emails for different departments (Careers, Support, Legal, Operations, Partnerships), summarizes the content and forwards it to the appropriate Discord channel.

Built for productivity, team alignment, and instant issue management. πŸš€


🎯 Features

βœ… Real-time email forwarding via Postmark Webhook
βœ… Automated summarization using Gemini / LLM
βœ… Auto-routing to relevant Discord channels based on the email address
βœ… Supports attachments and file relaying
βœ… Interactive buttons for support teams to respond quickly
βœ… Modular and clean code with Quart + Discord.py

βš™οΈ Tech Stack


πŸ—οΈ Project Architecture


/project-root
β”œβ”€β”€ app.py                # Main application β€” runs both Discord bot & Quart server
β”œβ”€β”€ bot.py                # Discord bot button views
β”œβ”€β”€ gemini.py             #
…

How I Built It

  • Postmark Inbound Webhooks for core email parsing and forwarding
  • Postmark API to retrieve complete message data via Message ID
  • Discord.py to build the Discord bot, send messages, handle buttons, and manage threads
  • Quart as the asynchronous web server for webhook handling

How it Works

The app runs two asynchronous services. A Quart web server handles webhooks, and a Discord bot manages messages and actions.

Workflow Overview

  1. A new email arrives at Postmark.
  2. Postmark's inbound webhook forwards the email payload to the /webhook endpoint.
  3. The server extracts key details like sender info, subject, body text, and attachments.
  4. It determines the appropriate Discord channel based on the email address.
  5. The message is summarized using Gemini AI. Attachments are decoded and a clean message template is prepared.
  6. The bot posts this into the right channel, starting a dedicated thread per sender.
  7. Action buttons like β€œShow Full Email” and β€œMark as Resolved” are attached.

Challenges

Managing both the asynchronous Quart server and Discord bot within a single process required careful event loop handling. Async conflicts, especially with asyncio.run(), demanded thoughtful debugging and examples from public repositories.

Handling attachments was another tricky area. Postmark delivers them as base64 strings, which needed decoding and repackaging as Discord File objects while preserving file metadata.

Discord.py’s documentation around custom button views was limited. After exploring community examples and third-party resources, I was able to implement this functionality effectively.

Conclusion

I am proud of how this project came together. It is functional, cleanly built, and addresses a genuine workflow problem for modern operational teams. In future, I am planning to build a lightweight priority detection system for support emails and using Postmark's Transactional Email service for reply

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.