Skip to main content

benecaster_donor_enrolled_as_follower

Action Premium

Fires after a donation succeeds and a brand-new follower account is created for the donor’s email address. It runs only when the show has the donor mailing-list opt-in enabled and that donor ticked the box — consent is a precondition, not something to check for yourself afterwards.

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.

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