Skip to main content

benecaster_donor_enrolled_as_follower

Action Free Since v1.0.0

Fires after a donation payment succeeds and a brand-new follower account is provisioned for the donor’s email address. Triggered by StripeWebhookController::handle_payment_intent_succeeded() after benecaster_donation_received, only when the show’s “Donor mailing-list opt-in” toggle is enabled and the donor checked the opt-in checkbox.

This action fires only when a genuinely new WordPress user is created — it does not fire when the donor’s email already belongs to an existing user at any status (paying subscriber, cancelled subscriber, existing follower, or any other WP user). Use this hook to push newly enrolled followers to an external newsletter platform or CRM.

The $donation_reference parameter is the Stripe PaymentIntent ID from the completed payment. Use it to correlate the follower record with the donation record in your external system.

Parameters

Name Type Default Description
$user_id int WordPress user ID of the newly created follower account
$show_id int ID of the show whose donation form enrolled the follower
$donation_reference string Stripe PaymentIntent ID from the completed payment

Examples

Push a donation-enrolled follower to a newsletter platform

add_action( 'benecaster_donor_enrolled_as_follower', function( int $user_id, int $show_id, string $donation_reference ): void {
    $user = get_userdata( $user_id );
    if ( ! $user ) {
        return;
    }
    wp_remote_post( 'https://api.convertkit.com/v3/forms/YOUR_FORM_ID/subscribe', [
        'blocking' => false,
        'body'     => [
            'api_key'        => MY_CK_API_KEY,
            'email'          => $user->user_email,
            'first_name'     => $user->first_name,
            'tags'           => [ 'benecaster-donor', 'show-' . $show_id ],
            'fields'         => [ 'donation_reference' => $donation_reference ],
        ],
    ] );
}, 10, 3 );

Notes

The action does not fire for existing users — skipping silently is intentional (GDPR compliance; existing users may have already made a separate opt-in decision). The opt-in checkbox is unchecked by default on the donation form regardless of the show toggle — the donor must actively check it before this action can fire.