Skip to main content

benecaster_token_reactivated

Action Premium Since v1.0.0

Fires when a previously revoked token is restored to active status — for example, when a cancelled subscriber resubscribes to the same show. The existing token row is updated in place, so the subscriber’s feed URL is unchanged and their podcast app resumes receiving private content on its next poll without any manual intervention.

This hook and benecaster_token_generated are mutually exclusive per activation event — benecaster_token_generated fires on a fresh token insert; benecaster_token_reactivated fires on the revived-row path. Use this hook when you need to react specifically to a returning subscriber rather than a brand-new one.

Parameters

Name Type Default Description
$token_id int ID of the reactivated token record
$user_id int WordPress user ID
$show_id int ID of the show
$tier_slug string Tier slug for the reactivated subscription

Example

add_action( 'benecaster_token_reactivated', function( int $token_id, int $user_id, int $show_id, string $tier_slug ) {
    // Log the returning subscriber for win-back attribution.
    my_analytics()->track( 'subscriber_returned', [
        'user_id' => $user_id,
        'show_id' => $show_id,
        'tier'    => $tier_slug,
    ] );
}, 10, 4 );

Notes

This is a Premium hook — it is only registered when a valid license is active. The $token_id is the same ID as the original token — the row is updated in place, not replaced. No new plaintext token is minted, and the subscriber's feed URL does not change.

Not every reactivation attempt reaches this hook. When the revoked row was revoked by an admin action, reactivation is refused and benecaster_token_reactivation_blocked fires instead. The two are mutually exclusive per activation dispatch.