WP Webhooks / Automations / Create a WordPress user from a Contact Form 7 submission

Create a WordPress user from a Contact Form 7 submission

Every Contact Form 7 submission becomes a WordPress user.

The webhook posts to the site's own REST API (/wp/v2/users) using a vault credential, so no password ever travels in the build. Field mapping carries your-email and your-name across; a pre-dispatch Code Glue snippet fills in the two fields the REST endpoint requires but the form does not collect — a username derived from the email address, and a generated password.

Before importing: point the endpoint at your own site, create a credential for a user who can create accounts, and check that the form field names match your form.

/ The conversation

This build was not assembled by hand. Its author described what they wanted in Build with AI, and the agent read the site, planned the work and applied it. This is that conversation.

model gemini-flash-latest via hosted AI credits
Author

lets create new user from cf7 submission, use WP rest APi to create that user

Build with AI

Checking the captured payload for Contact Form 7 submissions, the WP REST API schema for user creation, and existing credentials...

Build with AI

I've analyzed the Contact Form 7 captured payload and the REST API requirements for creating users (/wp/v2/users).

Plan Overview:

  1. Create Webhook: Target https://example.com/wp-json/wp/v2/users on wpcf7_mail_sent (asynchronous mode).
  2. Assign Auth Credential: Use existing internal WP REST API credential (ID: 29).
  3. Map Payload Fields: Map your-email to email and your-name to name.
  4. Code Glue Snippet: Automatically generate the required username (from email prefix) and a secure random password prior to dispatch.
  5. Preview & Assign Snippet: Attach the snippet to pre-dispatch.
  6. Test Dispatch: Run a test submission to verify end-to-end integration.

Published by the author on purpose. Tool output and raw payloads never travel with a shared build, and secrets never leave the site they were created on.

/ Abilities used (7)

  1. create_webhook Create webhook pointing to local WP REST API user endpoint
  2. assign_credential Attach internal REST API credential (ID 29) to the webhook
  3. set_mapping Map CF7 email and name fields to WP User arguments
  4. create_snippet Create pre-dispatch PHP snippet to generate required username and password
  5. preview_snippet Preview pre-dispatch snippet transformation against captured payload
  6. assign_snippet Assign pre-dispatch snippet to webhook trigger
  7. test_dispatch Execute test dispatch to verify user creation in WordPress

Each of these is a real ability the agent can call — see the docs for what each one does.

/ What runs

Create WP User from CF7 Submission
WordPress fires
wpcf7_mail_sent
Field mapping
2 fields mapped
Code Glue
Generate Username & Password for WP User Creation before sending
Queued, then sent
POST https://example.com/wp-json/wp/v2/users with your credential

Every attempt is retried on its own schedule and written to the delivery log.

WordPress fires the action wpcf7_mail_sent, the payload is mapped and sent as POST to example.com. The delivery is queued and sent in the background, so the visitor never waits. Along the way a Code Glue snippet shapes the payload first and authentication comes from a credential you supply on import.

/ How it is configured

Create WP User from CF7 Submission
wpcf7_mail_sent

/ Field mapping

args.0.submission.fields.your-email email
args.0.submission.fields.your-name name

/ Code Glue

before sending — Generate Username & Password for WP User Creation
if (!empty($payload['email'])) {
    if (empty($payload['username'])) {
        $payload['username'] = strstr($payload['email'], '@', true) ?: $payload['email'];
    }

    if (!empty($payload['username'])) {
      $payload['username'] = str_replace(' ', '-', $payload['username']);
      $payload['username'] = preg_replace('/[^A-Za-z0-9\-]/', '', $payload['username']);
    }

    if (!empty($payload['name'])) {
      $payload['name'] = str_replace(' ', '-', $payload['name']);
      $payload['name'] = preg_replace('/[^A-Za-z0-9\-]/', '', $payload['name']);
    }
    if (empty($payload['password'])) {
        $payload['password'] = wp_generate_password(16, true);
    }
}
return $payload;

Read any snippet before you import it — Code Glue runs PHP on your site.

/ Authentication

This build authenticates with a credential you supply on import. The shared file carries the name and type only — never the secret.

  • WP REST API (internal) — admin — basic

/ Use this build

Download the file, then in WordPress open Webhook Actions → Webhooks → Import and drop it in. Anything needing authentication asks you to pick or create a credential as it imports — see Import & Export for what travels with a build and what does not.

A like sends 20 AI credits to whoever published this.

/ Published by

Flow Systems

/ Questions

Do I need the Pro plugin for this build? +
Yes. This build attaches Code Glue snippets, which are a Pro feature. Everything else in it — the webhook, its triggers, the field mapping and the conditions — works on the free plugin.
How do I use it on my own site? +
Download the JSON, then in WordPress open Webhook Actions → Webhooks → Import and drop the file in. Anything that needs authentication asks you to pick or create a credential during the import — secrets are never part of a shared build.
Does the build contain the author's API keys? +
No. Export carries credential metadata only — the name, the type and a masked hint — never the secret itself. The Credentials Vault is write-only over the API by design.
Publish

Publish your automation and get 50 AI credits,
+20 for each like.

$ wp plugin install flowsystems-webhook-actions --activate