Skip to main content

BlockedReactivationNoticePublisher

\Benecaster\Token\BlockedReactivationNoticePublisher

Class Premium

Turns a refused reactivation into something the podcaster actually sees. Hooks benecaster_token_reactivation_blocked and publishes a Warning-tier admin notice through NoticeManager::publish(). Wired in Plugin::register_admin().

The problem it solves is silence. When a subscriber with a deliberately revoked token resubscribes, the guard refuses reactivation — correctly — but without this the podcaster would never learn that somebody is paying and receiving nothing. The longer that runs, the likelier it ends as a chargeback rather than a support question.

Also hooks benecaster_token_reset and deletes the matching notice once the podcaster reinstates access, so the notice clears itself rather than needing to be dismissed.

Constructor Dependencies

Type Description
\Benecaster\Notices\NoticeManager Publishes and deletes the notice.

Notes

Deduplicated per token. The notice slug is benecaster_token_blocked_reactivation_{$token_id}, backed by the benecaster_notices.notice_id UNIQUE KEY — so repeated activation attempts by the same subscriber produce one notice, not a stream of them. re_dismiss_after = 1 day, so a dismissed notice returns while the situation is unresolved.

The notice clears on benecaster_token_reset, not on the next successful activation — because Reset Token is the only path that reinstates a deliberately revoked subscriber. If it cleared on activation, it would vanish on the very event it exists to report.