Skip to main content

Trigger a re-engagement automation when a subscriber goes silent

Premium Intermediate

When a subscriber stops polling their feed for longer than the configured threshold, Benecaster marks them at_risk and fires benecaster_subscriber_feed_inactive — once, not daily. This recipe enqueues a re-engagement sequence in an ESP and shows how to override the threshold in code for a show where the usual gap is longer.

Pair with benecaster_subscriber_feed_reactivated to cancel the automation and restore the subscriber to an active segment when they return.

Notes

Once per inactivity event: The hook fires when engagement_status transitions from 'active' to 'at_risk'. It does not re-fire on subsequent daily cron runs while the subscriber remains silent. The next firing opportunity is after the subscriber reactivates (benecaster_subscriber_feed_reactivated) and then goes silent again.

Never-accessed tokens are excluded: Subscribers who signed up but never added the feed to a podcast app (last_accessed_at = NULL) do not trigger this hook. They are a different state with its own hook, benecaster_subscriber_never_accessed. Build a separate automation for subscribers who sign up but never start listening.

Per-show threshold: Monthly or bi-weekly shows have a naturally longer listening cadence than daily or weekly ones. The podcaster sets the window per show first, in Show Settings → Subscription → Feed inactivity threshold (default 30 days). Use benecaster_subscriber_engagement_threshold only for a rule that field cannot express; it runs on top of that value and can raise or lower it. To show the number in your own screens, call benecaster_get_engagement_threshold() — see Show the inactivity threshold in your add-on.

Related Hooks

Code

<?php
add_action(
    'benecaster_subscriber_feed_inactive',
    function ( int $user_id, int $show_id, string $tier_slug, int $days_inactive ): void {
        $user = get_userdata( $user_id );
        if ( ! $user ) {
            return;
        }
        my_esp_add_tag( $user->user_email, 'podcast-inactive' );
        my_esp_trigger_sequence( $user->user_email, 're-engagement', [
            'show_id'       => $show_id,
            'days_inactive' => $days_inactive,
        ] );
    },
    10,
    4
);

// Optional: a monthly show needs a longer threshold. Set it in Show Settings →
// Subscription → Feed inactivity threshold; the filter is for a rule the field
// cannot express, and runs on top of that value.
add_filter(
    'benecaster_subscriber_engagement_threshold',
    function ( int $days, int $show_id ): int {
        return $show_id === MY_MONTHLY_SHOW_ID ? 60 : $days;
    },
    10,
    2
);

View on GitHub →

Hooks Used

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