Postmark Challenge: Inbox Innovators - Transform any email address into an intelligent business automation engine
Leadmark converts your email inbox into a powerful AI assistant that handles customer inquiries, schedules meetings, and processes leads automatically using Postmark's inbound email parsing capabilities.
Turn Email Into Your Most Powerful Business Tool:
- โ๏ธ Smart Email Responses: AI analyzes incoming emails and responds with contextual, business-specific information
- ๐ Automatic Meeting Booking: Detects scheduling requests and books meetings directly in Google Calendar
- ๐ Lead Qualification: Custom forms capture and qualify prospects automatically
- ๐ง Business Context Aware: Upload documents (PDF/DOCX) to train your AI assistant about your business
- โก Real-time Processing: Instant responses powered by Postmark's webhook infrastructure
- GPT-4 Integration: Contextual responses based on your business objectives
- Document Intelligence: AI analyzes uploaded business documents for better responses
- Custom Personas: Define specific AI assistant roles and behaviors
- Conversation Memory: Maintains context across email threads
- Google Calendar Integration: Automatic availability checking and booking
- Conflict Detection: Prevents double-booking with intelligent scheduling
- Time Zone Handling: Supports global meeting coordination
- Meeting Confirmations: Automated calendar invites and confirmations
- AI-Generated Forms: Creates custom contact forms based on your business
- Real-time Processing: Form submissions trigger immediate email workflows
- Lead Qualification: Automatically scores and categorizes prospects
- CRM Integration: Structured data collection for business insights
๐ง Postmark Inbound โ ๐ Processor API โ ๐ง AI Engine โ ๐ค Postmark Outbound
โ
๐ Web Dashboard โ ๐พ Supabase Database
Tech Stack:
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Backend: Express.js, BullMQ, Redis
- Database: Supabase (PostgreSQL) with real-time subscriptions
- AI: OpenAI GPT-4 with function calling
- Email: Postmark inbound/outbound processing
- Calendar: Google Calendar API
- Storage: Supabase Storage for document processing
- Node.js 18+
- pnpm
- Postmark account (free trial available)
- Supabase account
- OpenAI API key
- Google Calendar API credentials (optional)
- Clone the repository
git clone https://github.com/tecmie/leadmark.git
cd leadmark- Install dependencies
pnpm install- Environment Setup
Create .env.local in apps/web/:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Google Calendar (optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretCreate .env in apps/processor/:
# Postmark
POSTMARK_API_KEY=your_postmark_server_token
# Database
DATABASE_URL=your_supabase_database_url
# Redis
REDIS_URL=redis://localhost:6379
# OpenAI
OPENAI_API_KEY=your_openai_api_key- Start the development servers
# Terminal 1 - Web app
pnpm dev
# Terminal 2 - Email processor (new terminal)
cd apps/processor
pnpm dev- Configure Postmark Webhook
- In your Postmark account, set up an inbound server
- Point the webhook URL to:
https://your-domain.com/api/postman - Configure your inbound email address (e.g.,
inbox@yourdomain.com)
- Sign up and create your unique email address (e.g.,
yourname@leadmark.email) - Define your AI assistant's objective and personality
- Upload business documents (PDFs, Word docs) for context
- Choose or customize a lead capture form template
๐ง Customer sends email to yourname@leadmark.email
โ
๐ Postmark webhook triggers processor
โ
๐ง AI analyzes email content + business context
โ
๐
Detects meeting request โ Books calendar appointment
OR
๐ฌ Generates contextual business response
โ
๐ค Sends professional reply via Postmark
โ
๐ Updates dashboard with conversation history
Customer Inquiry:
From: client@company.com
Subject: Web Development Services
Hi, I'm looking for a web development team to build
an e-commerce platform. What's your process and pricing?
AI Response (auto-generated):
Hi there!
Thanks for reaching out about web development services.
I'd be happy to help with your e-commerce platform.
Our development process includes:
- Discovery & requirements gathering
- UI/UX design phase
- Development & testing
- Launch & ongoing support
For e-commerce projects, we typically work with Shopify
or custom solutions depending on your needs.
I'd love to schedule a call to discuss your project in detail.
Are you available this week for a 30-minute consultation?
Best regards,
[Your Name]
Meeting Scheduling:
From: prospect@business.com
Subject: Schedule a Demo
Can we set up a demo call sometime next week?
AI Response + Calendar Booking:
Absolutely! I've checked my calendar and have these times available:
โข Tuesday, June 4th at 2:00 PM EST
โข Wednesday, June 5th at 10:00 AM EST
โข Thursday, June 6th at 3:00 PM EST
Just reply with your preferred time and I'll send a calendar invite.
Looking forward to showing you what we can do!
leadmark/
โโโ apps/
โ โโโ processor/ # Email processing backend
โ โ โโโ src/
โ โ โ โโโ api/ # Postmark webhook handlers
โ โ โ โโโ services/ # AI, calendar, database services
โ โ โ โโโ events/ # BullMQ job processing
โ โ โโโ package.json
โ โ
โ โโโ web/ # Next.js frontend dashboard
โ โโโ app/ # App router pages
โ โโโ components/ # Reusable UI components
โ โโโ actions/ # Server actions
โ โโโ package.json
โ
โโโ packages/
โ โโโ types/ # Shared TypeScript definitions
โ
โโโ README.md
โโโ package.json
- Webhook Endpoint:
/api/postman - Validation: Mailbox ownership and sender verification
- Processing: Async job queue with BullMQ for scalability
- Features: Full email parsing including attachments, headers, and metadata
- Rich Responses: HTML + Plain text formatting
- Thread Management: Maintains conversation context
- Professional Formatting: Branded email signatures and styling
- 24/7 Customer Service: Never miss an inquiry, even outside business hours
- Professional Image: Consistent, well-written responses build credibility
- Time Savings: Automate 80%+ of routine email responses
- Lead Generation: Convert more prospects with immediate, helpful responses
- Streamlined Booking: Clients can schedule meetings without back-and-forth
- Consistent Branding: Professional responses reflect your expertise
- Scalability: Handle more inquiries without hiring support staff
- Beyond Basic Parsing: Combines Postmark's infrastructure with advanced AI
- Production Ready: Enterprise-grade architecture with proper error handling
- Real Business Value: Solves actual problems faced by small businesses
- Type Safety: Full TypeScript implementation
- Modern Stack: Latest React, Next.js, and Node.js technologies
- Scalable Design: Microservices architecture with event-driven processing
- Real-time Features: Live dashboard updates and instant email processing
- ๐ฑ Mobile App: iOS/Android apps for on-the-go management
- ๐ CRM Integrations: Connect with Salesforce, HubSpot, Pipedrive
- ๐ Analytics Dashboard: Email performance and response analytics
- ๐ Multi-language Support: AI responses in multiple languages
- ๐ Enterprise Features: Team management, advanced security, custom domains
Email conversations, meeting scheduling, and lead management in one place
Custom business objectives and document upload for context
Watch emails arrive and responses sent automatically
This project was built for the Postmark Challenge: Inbox Innovators.
Built with โค๏ธ for the Postmark community
- Lead Developer: Tecmie Leadmark Team
- Challenge: Postmark Inbox Innovators 2024
- Demo: [Live Demo URL]
- Video: [Demo Video URL]
Transform your email from a time sink into your most powerful business automation tool with Leadmark.