Skip to main content

benecaster_subscribe_user_created

Action Free

Fires when a logged-out visitor completes the [benecaster_subscribe] shortcode and a new WordPress user account is created for them. It fires immediately after the account is created for a guest signup — before the subscription row is written, the feed token is generated, or the Stripe subscription is created on the paid path.

It fires only on guest signups that create a new WP account. It does not fire when a logged-in subscriber signs up, when the email matches an existing WP account (the endpoint returns 409 benecaster_login_required), or on free-tier signups where the user is already logged in.

Benecaster sends no set-password email from this hook. The signup form asks the visitor to choose their own password, on both the free and the paid branch, so the account already has a password the subscriber knows and there is nothing to email them a link for. The set-password email belongs to benecaster_subscriber_account_provisioned, which fires only for accounts created for somebody — bulk enrollment, manual add, the donation webhook.

Use this hook for work Benecaster does not do — CRM enrollment, tagging, analytics.

Do not look up tokens or feed URLs from this hook — the token does not exist yet. Use benecaster_token_generated for post-token work.

Parameters

Name Type Default Description
$user_id int — WordPress user ID of the newly created account
$email string — Email address used to create the account (same as the user's user_email)
$show_id int — ID of the show being subscribed to.

Examples

Enroll the new account in an onboarding sequence

add_action( 'benecaster_subscribe_user_created', function ( int $user_id, string $email, int $show_id ): void {
    // The subscriber chose their own password on the form, so they can
    // already log in. Use this hook for work Benecaster does not do —
    // CRM enrollment, tagging, analytics.
    my_crm()->subscribe( $email, [
        'list'    => 'podcast-onboarding',
        'show'    => get_the_title( $show_id ),
        'user_id' => $user_id,
    ] );
}, 10, 3 );

Notes

Do not send a set-password email from this hook. The person who reached it typed a password into the signup form seconds ago. A reset link would be confusing, and it is not what they need — they can log in already.

This hook fires before the subscription row, the feed token, and the Stripe subscription exist. Anything that needs those belongs on a later hook.

Need this built rather than just documented? See our services →