DEV Community

Cover image for leadmark.email: Turn Your Inbox into a Sales Automation Engine via Postmark
Andrew Miracle
Andrew Miracle

Posted on

leadmark.email: Turn Your Inbox into a Sales Automation Engine via Postmark

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

Leadmark – AI-Powered Inbox Automation
Hackathon Submission for Postmark’s Dev Inbox Challenge

🔗 Live demo: https://www.leadmark.email
📂 Source code: https://github.com/tecmie/leadmark


🛠️ The Problem

Medium to Large scale Sales teams across several industries from enterprise to real-estate receive an average 300–1,000 new leads per day, yet spend 1–4 hours per rep just qualifying them. At $20–30 USD hour × 20 reps, that’s roughly 40 hours—or $1,000 USD—burned daily on unqualified prospects.


💡 The Solution

leadmark.email transforms every inbound email lead into an intelligent, AI-driven workflow—powered by Postmark’s Inbound Email Parsing. The core innovation? Treating each unique email address as an API endpoint that triggers business automation in real time.

Setting up your mailbox and Assistant

In this quick walkthrough, I show you exactly how to configure Leadmark's AI “assistant objective”—so you can start automatically qualifying and responding to leads in seconds.

Automating Qualification and Mail + Scheduling and Contacts

In this extended demo, we pick up right where the mailbox & AI assistant setup left off—and dive into every corner of the Leadmark app. From your email dashboard and workspace to built-in calendar scheduling and user profile management, see how leadmark.email turns your inbox into a seamless, end-to-end sales automation platform.


How leadmark.email Uses Postmark’s Inbound Email Parsing

  • Webhook Processing: Real-time parsing via a worker with a webhooks /api/postman endpoint.
  • Full Message Extraction: Captures headers, body content, attachments, and metadata to enable MX routing for multiple custom email inboxes (i.e [email protected])
  • Bidirectional Communication: Inbound parsing + outbound response sending through Postmark’s API.
  • Production Architecture: Async job processing (BullMQ/Redis), robust error handling, and horizontal scaling.

Example of a simple lead-gen form for a Gym Franchise & Real Estate Investment Firm https://www.leadmark.email/form/candidate-contact-form.

This form is linked to an actual email from a demo real estate agency and filling the form will automate a lead qualification cycle up to the point where a meeting is booked between you and an Account Manager


Key Features + Postmark

  1. Smart Email Replies

    • Parse emails via Postmark webhooks
    • AI analyzes content for qualification and responds in real-time via Postmark’s outbound API
  2. Auto Meeting Booking

    • Detects scheduling intent
    • Checks Google Calendar and books meetings, sending email confirmations
  3. Lead Scoring Pipeline

    • Processes emailed form submissions
    • Scores and categorizes leads, triggering follow-ups to managers
  4. Document-Savvy Chats

    • Parses PDF/DOCX attachments
    • Extracts data for AI responses, maintaining thread context

🛠️ Technical Implementation

1. Postmark Webhook Handler

// apps/processor/src/api/postman.ts
router.post<{}, PostmanResponse>("/", async (req, res) => {
  const input = req.body as InboundMessageDetails;
  // Validate mailbox ownership
  const mailboxWithOwner = await _validateMailbox(input.To);
  // Async processing
  await postmanEventProducerMQ.postman(input);
  res.json({ message: "Webhook received" });
});
Enter fullscreen mode Exit fullscreen mode

2. GPT + Tools + Conversational AI

// Generate AI response
const { aiResponse, aiResponseToHtml } = await getAIResponse({
  thread, messageText, mailbox, contact, name });
// Send via Postmark outbound API
await postmark.sendEmail({
  From: `${owner.full_name} <${mailbox.unique_address}>`,
  To: input.FromFull.Email,
  Subject: replySubject,
  HtmlBody: aiResponseToHtml,
  TextBody: aiResponse,
});
Enter fullscreen mode Exit fullscreen mode

3. Architecture Flow

Email is sent to Postmark Inbound, which parses it into JSON and sends it via webhook to /api/postman. The API enqueues the job in BullMQ/Redis. The job is processed by Parsing & Scoring, which extracts data and sends it to the AI/Rules Engine for lead qualification. The engine returns a decision, stored in Supabase/Postgres. Parsing & Scoring triggers an auto-reply or forward via Postmark Outbound to the recipient. Real-time updates from the database reflect lead status on the Dashboard.

Image description


📈 Impact & Metrics

  • About $750 USD per day saved for an average 20-rep team
  • <30 s from email arrival to qualification & routing
  • 98%+ parsing accuracy in pilot tests
  • 90%+ rule-based filtering accuracy out of the box

🔮 What’s Next

  • AI-Driven Scoring: Swap keyword rules for fine-tuned GPT models
  • Visual Dashboard: Live metrics, rule-builder UI, executive insights
  • Omni-Channel: Integrate WhatsApp look into contacts for 360 engagement
  • Team Management: Role-based access, multi-domain support

🙏 Get Started in Minutes

  1. Clone & install:
   git clone https://github.com/tecmie/leadmark.git
   cd leadmark && npm install
Enter fullscreen mode Exit fullscreen mode
  1. Set environment variables:
  • POSTMARK_API_KEY, SUPABASE_URL, SUPABASE_KEY
  • GOOGLE_CALENDAR_CREDENTIALS, OPENAI_API_KEY (for AI)
    1. Run:
   npm run dev
Enter fullscreen mode Exit fullscreen mode
  1. Configure Postmark:
  • Point your inbound webhook to https://<your-domain>/api/postman

LeadMark turns every email into a revenue-driving, AI-powered workflow—powered by Postmark’s Dev Inbox!

Code Repository

🔗 https://github.com/tecmie/leadmark

Team Members

This submission was built by @koolamusic and the Tecmie team.

Image description

Top comments (0)