Win back members whose membership lapsed, not the ones who chose to leave
A lapse (a fixed term ran out, renewals gave up) and a cancellation are different conversations. benecaster_subscription_cancelled fires for both; benecaster_subscription_expired fires only for the lapse, straight after it.
benecaster_subscription_cancelled fires for lapses too, and before expired — so a “you cancelled” message sent from it reaches lapsed members as well. Treat cancelled as “ended, reason unknown” and put lapse-specific messaging on expired.
Custom bridges must report the lapse — pass 'expired' as the third argument of the on_subscription_cancelled() callback — or this never fires for their members.
Code
<?php
add_action( 'benecaster_subscription_expired', function ( int $user_id, int $show_id, string $tier_slug ): void {
$user = get_userdata( $user_id );
if ( ! $user ) {
return;
}
// "Your card stopped working" rather than "sorry to see you go".
my_esp_add_tag( $user->user_email, 'lapsed-' . $tier_slug );
}, 10, 3 );
Hooks Used
Need this built rather than just documented? See our services →