Skip to main content

Act when a migrated subscriber signs up — and not for every other new subscriber

Premium Beginner

The obvious hook is Benecaster’s benecaster_subscription_activated, but that fires for every signup on the site — a callback there would thank a brand-new listener for finishing a migration they were never in. benecaster_migration_subscriber_completed fires only for someone who was in an open migration on that show.

It fires once per person, even when a payment is confirmed twice (by the browser and by the payment webhook), so the callback needs no guard of its own. $tier_slug is what they signed up for, which can differ from the tier they were mapped to.

Code

<?php
add_action(
    'benecaster_migration_subscriber_completed',
    function ( int $user_id, int $show_id, string $tier_slug ): void {
        // Their migration record already reads "signed up", so reading it here is safe.
        my_crm_tag( $user_id, 'migration-completed', $tier_slug );
    },
    10,
    3
);

View on GitHub →

Hooks Used

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