tr Skip to content

When a new subscription is created in Stripe, get the user by email in WordPress and update custom field value

When a customer signs up for a new plan in Stripe, FlowMattic finds the WordPress user with the same email and writes a value to one of their Advanced Custom Fields user fields, such as a plan or status.

Stripe WordPress Advanced Custom Fields

3 steps Setup ~5 min Used on 2.4k sites Free to import

The When a new subscription is created in Stripe, get the user by email in WordPress and update custom field value workflow on the FlowMattic canvas, with 3 steps across Stripe, WordPress, Advanced Custom Fields
The workflow as it appears in the builder after import. Each step opens for editing.

What this workflow does

If your site shows members different content based on their plan, the plan needs to be stored on the WordPress user. Stripe knows who subscribed, but WordPress doesn't, unless someone copies it over. This workflow connects the two by matching the subscriber's email to a WordPress user.

The Stripe trigger, New Subscription, fires whenever a customer is signed up for a new plan. The next step, WordPress Get User by Email, looks up the user profile with the email you map from Stripe. Its result includes the user's ID. The last step, Advanced Custom Fields Update User Value, uses that ID to update a custom field value on the user.

The flow only works for people who already have a WordPress account with the same email they used in Stripe. When the lookup finds nobody, the update has no user to write to and Task History shows the error on that step. Stripe's subscription data may name the customer only by an ID. If your test run shows no email there, put Stripe's Find Customer by ID before the WordPress lookup and take the email from its result.

Membership level on a content site

A reader who subscribes in Stripe gets a plan field on their WordPress user set to Premium, which your templates can check to show members-only content.

Marking customers as active subscribers

A software site writes a subscription status field on the user, so the account area shows that their plan is active.

Storing the Stripe subscription ID

Save the new subscription's ID in an ACF user field, so support staff can find the right Stripe record from the WordPress user screen.

How this workflow runs

What happens at each step once the workflow is on, and what you need before you import it.

  1. Step 1Trigger
    Stripe New Subscription

    Runs whenever a customer is signed up for a new plan in Stripe. The subscription data, including the customer details Stripe sends, is passed to the next steps.

  2. Step 2Action
    WordPress Get User by Email

    Looks up the WordPress user profile by email. Map the customer's email from the Stripe event. The step returns that user's profile, including the user ID the next step needs.

  3. Step 3Action
    Advanced Custom Fields Update User Value

    Updates a custom field value on the WordPress user found in the previous step. Map the user ID from Get User by Email, choose the ACF user field, and set the value, either fixed or from Stripe.

What you need

  • FlowMatticCore
  • Stripe AccountAccount
  • Advanced Custom Fields PluginPlugin

After importing, map your own data. To keep the template universal, not every step is pre-filled. Open each step in the builder and connect your accounts and fields (channels, lists, sheets, recipients) before you switch the workflow on.

Make it yours

Changes worth making after you import it.

  • After import, create a subscription for a customer whose email matches a real WordPress user, then confirm the ACF field changed on that user's profile.
  • Add a Filter after the Stripe trigger on the plan or price if only one plan should set the field, so other subscriptions leave it alone.
  • To reverse the value when a plan ends, build a second workflow on Stripe's Subscription Deleted trigger with the same lookup, setting the ACF field back.

Questions about this workflow

What if the Stripe customer has no WordPress account?

Get User by Email finds nobody, so the ACF step has no user ID and can't update anything. That run's ACF step is marked with an error in Task History. Make sure subscribers have a WordPress account with the same email before they pay.

Which email is used to find the WordPress user?

Whichever Stripe value you map into Get User by Email. Run a test subscription and check the trigger step's captured data to pick the field that holds the customer's email.

Does the ACF field need to exist on users already?

Yes. Create the field in Advanced Custom Fields and show it on user profiles before testing, so the Update User Value step has a field to write to.

Do repeat Stripe subscriptions update the same WordPress user?

Yes. Each new subscription starts a run, finds the user by email again and writes the field again. The latest run's value is what stays on the profile.

Import this workflow into your WordPress site

Download the JSON, import it from the Workflows screen and connect your accounts. Every run stays on your server, with no per-task fees.

30-day money-back guarantee Unlimited workflows and runs Self-hosted

Customers who run it every day

Rated 4.8 out of 5 by customers
Read more reviews

Ease of use and terrific support from the founder. Tons of integrations and regular updates. The Flowmattic custom app is great especially if you want to integrate apps that aren't available yet inside Flowmattic.

Cliede C.

Flowmattic is a noteworthy option for businesses looking for a self-hosted alternative to Zapier. With its user-friendly interface and a strong set of features, it is a top pick for those in need of a reliable WordPress automation solution.