Skip to main content

benecaster_subscription_cancelled

Action Premium Since v1.0.0

Fires when any bridge reports that a subscription has been cancelled. This hook is bridge-agnostic — it fires regardless of which membership plugin triggered the cancellation. The subscriber’s token is marked inactive after this hook fires, and feed access ends on the subscriber’s next poll.

Note there is a brief window between when this hook fires and when the subscriber’s next feed request arrives. During that window, the subscriber may still have feed access even though their token is deactivated.

Parameters

Name Type Default Description
$user_id int WordPress user ID
$show_id int ID of the show
$tier_slug string Tier slug

Examples

Remove active tag and add churned tag in email platform

add_action( 'benecaster_subscription_cancelled', function (
    int $user_id,
    int $show_id
) {
    $email = get_userdata( $user_id )->user_email;

    my_email_platform_remove_tag( $email, 'active-subscriber' );
    my_email_platform_add_tag( $email, 'cancelled', [
        'show_id'      => $show_id,
        'cancelled_at' => current_time( 'mysql' ),
    ] );
}, 10, 2 );

Notes

This is a Premium hook — it fires only when a valid license is active.