See llms.txt for all machine-readable content.
Gemini reads every Contact Form 7 submission and sorts it into lead, support or spam. Leads are scored from 1 to 5 and saved to HubSpot with a note, support requests go to their own Slack channel, and spam never reaches your CRM.
{"your-name": "Ada Lovelace", "your-email": "[email protected]", "your-message": "..."}. WordPress calls it once per submission, right after Contact Form 7's own spam check. Header Auth keeps the endpoint private.business, since Gemini scores leads against it. Set sales_channel and support_channel, and adjust hot_score (default 4). If your form renamed the default fields, enter the new names for email_field, name_field and message_field. For an EU-hosted HubSpot account, change hubspot_app_url to https://app-eu1.hubspot.com.X-Webhook-Token with a long random value) and copy the production URL.gemini-3.1-flash-lite, a small, fast model that is enough for sorting enquiries.crm.objects.contacts.read and crm.objects.contacts.write scopes and connect its access token as a HubSpot App Token credential on Save to HubSpot and Add Note.chat:write scope, connect its bot token on Notify Sales and Notify Support, and invite the app to both channels (/invite @your-app), or Slack answers not_in_channel.wpcf7_before_send_mail hook. The free Webhook Actions plugin does it without code: new webhook on wpcf7_before_send_mail, map args.2.fields.your-name, args.2.fields.your-email and args.2.fields.your-message to the same names, add args.0.title as form_title and args.2.meta.url as page_url, and attach the header credential. A short PHP snippet that does the same is under Additional info.score.ai_summary and summary are ready to use.Who is this for. Small businesses and agencies whose leads arrive through a Contact Form 7 form on WordPress, and who are tired of sorting sales enquiries from support questions and SEO pitches by hand. Contact Form 7 saves nothing to the database, so there is no list to poll: without a webhook, the notification email is the only copy of a lead.
Why before_send_mail. Contact Form 7 validates the fields and runs its spam check first, then fires wpcf7_before_send_mail, and only then sends the email. Hooking in there means obvious spam never reaches the workflow, and a broken mail setup no longer loses leads. Gemini then catches the human-written spam that gets past Contact Form 7.
WordPress side without a plugin. Put this in functions.php or a custom plugin. List your form's field names in $fields, and replace the URL and the token with yours (the token must match the Header Auth credential in n8n):
add_action( 'wpcf7_before_send_mail', function () {
// Contact Form 7 has validated the fields and passed its spam check by now.
$fields = [ 'your-name', 'your-email', 'your-subject', 'your-message' ];
$payload = [];
foreach ( $fields as $field ) {
$payload[ $field ] = sanitize_textarea_field( wp_unslash( $_POST[ $field ] ?? '' ) );
}
$payload['form_id'] = absint( $_POST['_wpcf7'] ?? 0 );
$payload['page_url'] = get_permalink( absint( $_POST['_wpcf7_container_post'] ?? 0 ) ) ?: '';
$args = [];
$args['headers']['Content-Type'] = 'application/json';
$args['headers']['X-Webhook-Token'] = 'YOUR-TOKEN';
$args['body'] = wp_json_encode( $payload );
$args['blocking'] = false; // do not make the visitor wait for n8n
wp_remote_post( 'https://YOUR-N8N/webhook/wordpress-cf7-lead', $args );
} );