Skip to main content

benecaster_buyup_auto_granted

Action Premium

Fires when a subscriber is given a buy-up because it is priced at 0 on their billing period. It fires in four situations:

  • a billing period’s price becomes 0, and everyone already on that period is given it
  • someone signs up on that period and leaves the included buy-up ticked
  • a subscriber’s billing-period switch onto that period takes effect, and they left it ticked
  • a subscriber adds it back from their account page at a price of 0

Subscribers who have declined the buy-up are skipped in the first case. The grant is already recorded when it fires.

Do not assume the subscriber is getting it for the first time. The account-page case fires for someone who had it before, removed it, and has now added it back.

Parameters

Name Type Default Description
$user_id int — The subscriber given the buy-up.
$buyup_id int — ID of the buy-up.
$show_id int — The show the buy-up belongs to.

Examples

Send a note that the buy-up is included with their plan

add_action( 'benecaster_buyup_auto_granted', function ( int $user_id, int $buyup_id, int $show_id ): void {
    my_send_included_with_your_plan_note( $user_id, $buyup_id );
}, 10, 3 );

Notes

This is not a purchase, and benecaster_buyup_purchased does not fire for these subscribers. Anything that thanks a buyer or counts revenue stays correct by not listening here. Anything that provisions access for a holder should listen to both actions. A subscriber who switches off the period loses the buy-up, and that fires benecaster_buyup_revoked, not a separate action. See the recipe React to a free buy-up grant.

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