A client came to us with a familiar problem: their contact form was generating plenty of submissions, but most of them weren't real prospects — students doing research, competitors poking around, people who'd misread what the business actually did. Their sales team was spending an hour a day sorting signal from noise.
We didn't reach for a $200/month SaaS lead-scoring tool. We wired the Claude API directly into their existing WordPress contact form. Total build time: just under three hours, most of it spent on prompt design, not code.
A single wp_remote_post call to the Claude API, a carefully written system prompt, and a webhook to their CRM was the entire build. No plugin marketplace, no recurring SaaS fee beyond API usage — which ran under $15/month for their volume.
1. The brief: why this client needed lead qualification
The business was a B2B services company getting roughly 40 form submissions a week, of which maybe 8 were genuine sales opportunities. Manually triaging that took real time from someone who should have been closing deals, not reading form spam. They didn't need a new form — they needed the existing one to think.
2. Wiring the Claude API into the form handler (30 min)
Their form already posted to a custom handler in functions.php. We added a single step before the existing email-notification logic: send the submission content to Claude, get back a structured qualification score and reasoning, and attach both to the internal notification email.
// Called right after form validation passes
function fluxweb_qualify_lead( $fields ) {
$response = wp_remote_post( 'https://api.anthropic.com/v1/messages', array(
'headers' => array(
'x-api-key' => getenv( 'ANTHROPIC_API_KEY' ),
'anthropic-version' => '2023-06-01',
'content-type' => 'application/json',
),
'body' => wp_json_encode( array(
'model' => 'claude-sonnet',
'max_tokens' => 300,
'messages' => array( array(
'role' => 'user',
'content' => fluxweb_build_prompt( $fields ),
) ),
) ),
'timeout' => 15,
) );
return json_decode( wp_remote_retrieve_body( $response ), true );
}
3. Designing the qualification prompt (45 min)
This is where almost all the real effort went. The first version of the prompt was too lenient — it scored nearly everything as "qualified" because it was reasoning in the abstract rather than against the client's actual ideal customer profile. We rewrote it with concrete criteria pulled directly from the client's sales team: company size signals, budget language, and specific red flags they'd learned to recognise manually.
"The prompt is doing the job a junior SDR would do in the first thirty seconds of reading an inbound lead. The trick is writing down what that junior SDR is actually looking for, because most sales teams have never had to articulate it."
— Tom Baxter, Full-Stack Developer
We landed on a structured system prompt that asked for three things back: a qualification score (1–10), a one-line reason, and a suggested next action (respond personally, send automated info, or deprioritise). That structure made it trivial to route programmatically.
4. Routing qualified leads to CRM and email (45 min)
With a score in hand, routing was simple conditional logic: scores of 7+ triggered an immediate Slack notification to the sales lead via webhook, mid-range scores went into the CRM with the AI's reasoning attached as a note, and low scores were logged but didn't interrupt anyone. Read more about how we approach this kind of build on our AI Integration service page.
We didn't auto-reject any lead outright — the AI's job is to prioritise, not gatekeep. Every submission still reaches the CRM; the scoring just determines how loudly it announces itself.
5. Results after 30 days
The sales team's daily triage time dropped from roughly an hour to under ten minutes. More importantly, response time to genuinely qualified leads dropped from an average of 6 hours to under 30 minutes, because the Slack alert meant someone saw it immediately instead of it sitting in an inbox.