When we launched new community Discord and Slack bots at Mintlify, we needed to do some customer marketing to let users with large communities know about them. The goal was straightforward: send an email sequence to the 3–10 people from each organization who could get value from the feature. Once one person from an org enables the bot, the task is complete — there’s no reason to keep emailing everyone else from the same company. I thought any of the email marketing tools out there would handle this trivially. They don’t. Every tool available handles campaigns at the user level, not the organization level. None of them have the concept of “stop emailing this group when any member takes action.” They’re all built for individual drip campaigns, not org-level outreach.Documentation Index
Fetch the complete documentation index at: https://mint.skeptrune.com/llms.txt
Use this file to discover all available pages before exploring further.
Defining the goal
The problem is specific but common in B2B:- You have multiple contacts per account — typically 3–10 people per org.
- You’re marketing a feature where one conversion per org is enough.
- Once anyone from the org takes action (replies, signs up, enables the feature), you want to stop the sequence for everyone else from that org.
- You don’t want to spam remaining contacts after the task is already done.
Tool selection
Claude Code has made me quite lazy insofar as I try to get everything done using it instead of doing things manually. My number one criteria when picking a tool to solve this was a large API surface that Claude could work with effectively. Instantly was the final selection given its API was the most robust and well documented. It gave Claude full access to campaigns, leads, and sequences, while also being capable of sending webhooks on reply and unsubscribe events.Kind of a random aside, but JAMstack architecture patterns are probably going to make a comeback with AI. Tools like tRPC are going to fall out of favor relative to OpenAPI-driven patterns that AI agents can better understand. Separation of UI and business logic is the way forward if you want your apps to be accessible to AI agents.
Solution architecture
The Instantly campaign holds the multi-email sequence and is configured to stop on reply. A lead upload script reads a CSV of contacts, groups them by company, and uploads them to Instantly with acompanyName custom variable.
Then a webhook server listens for reply events, finds all leads from the same company, and marks them as “not interested” to stop their sequences.
Creating the campaign
The campaign itself is straightforward. Setstop_on_reply to true so Instantly stops the sequence for whoever replies, then define your email steps with delays between them.
Uploading leads
The critical detail is including acompanyName custom variable with every lead. The webhook server uses that field to find all leads from the same company and unsubscribe them when a relevant event fires.
Registering the webhook
Tell Instantly to POST to your server whenever someone replies. You’ll need the campaign ID from the previous step.Webhook server
This is the part that makes it all work. When anyone replies, the webhook server extracts the company name, queries Instantly for all leads with that company name, and updates each lead’s status to stop their sequence.Instantly’s API does not support filtering leads by
company_name server-side — the search parameter only works on name and email fields. The implementation above fetches all leads for the campaign and filters client-side. For large campaigns you’d want to cache the result or build your own company-to-leads index to avoid repeated full paginations on every reply event.Hosting options
The server is stateless, so any hosting that can run Node.js works.- VPS (recommended)
- Serverless
- PaaS
A cheap VPS running Docker behind Caddy handles SSL termination and is the simplest long-term option. You control the machine and there are no cold starts.
Someone please build this
This solution works, but it’s more complex than it should be. The fact that I had to build a webhook server to get org-level behavior is absurd. This should be a checkbox in every B2B email tool. What the ideal interface looks like:Group contacts by company at campaign creation
Group contacts by company at campaign creation
Define groups of contacts by company when setting up a campaign, the same way you’d define a segment. The tool owns the grouping — you don’t have to encode it in a custom variable and maintain a separate lookup.
Toggle 'stop group on reply' as a campaign setting
Toggle 'stop group on reply' as a campaign setting
A single boolean on the campaign: if any member of a company group takes action (replies, clicks, converts), the tool stops the sequence for all remaining members of that group automatically.
No webhooks required
No webhooks required
The entire org-level stopping logic should live inside the email tool itself. A webhook server, client-side lead pagination, and a custom interest-status update should not be necessary for this use case.