benecaster_cancellation_confirmation_resume_url
Filters the resume URL included in the cancellation confirmation email. The default value is the subscriber account page permalink for the show (benecaster_account_page_url( $show_id )). Override this to deep-link into a specific section of the billing portal — for example, an anchor or query parameter that the account template listens for to open the resume-subscription flow directly.
Applied inside EmailTriggers::on_subscription_cancellation_requested(), which fires when a subscriber requests cancellation via the billing portal. The filtered URL is passed to the cancellation_confirmation email template as the $resume_url variable.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$account_url |
string |
— | The default subscriber account page URL for the show |
$user_id |
int |
— | WordPress user ID of the subscriber |
$show_id |
int |
— | WordPress post ID of the show |
$subscription |
array |
— | The subscriber's subscription row as an associative array |
Returns:
string
Examples
Deep-link into the billing portal resume flow
add_filter( 'benecaster_cancellation_confirmation_resume_url', function( string $account_url, int $user_id, int $show_id, array $subscription ): string {
return add_query_arg( 'action', 'resume', $account_url );
}, 10, 4 );
Notes
This filter fires only when the cancellation confirmation email is being sent — that is, when the race guard in on_subscription_cancellation_requested() confirms cancel_at_period_end is still set on the subscription row at listener time. If the subscriber resumed before the listener ran, the email is suppressed and this filter does not fire.
Affects
- Cancellation confirmation email resume link
Need this built rather than just documented? See our services →