benecaster_email_resubscribed
Fires when a subscriber opts back in to emails after having previously opted out. Use this hook to restore segments in external email marketing platforms, update CRM records, or log the re-opt-in event.
The $email_type parameter reflects the opt-out level being cleared: 'broadcast' means the subscriber is re-enabling non-transactional emails while transactional emails were never suspended; 'all' means they are fully re-enabling all Benecaster emails. The $method parameter records how the resubscribe was triggered — useful for auditing and compliance reporting.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$user_id |
int|null |
— | WordPress user ID, or null |
$show_id |
int |
— | ID of the show |
$email_type |
string |
— | Email type key |
$email_address |
string |
— | Email address |
$method |
string |
— | How the change was made — 'api' by default |
Examples
Re-add subscriber to broadcast list
add_action( 'benecaster_email_resubscribed', function(
?int $user_id,
int $show_id,
string $email_type,
string $email_address,
string $method
): void {
if ( $email_type === 'broadcast' ) {
my_esp_client()->add_to_list( $email_address, 'podcast-broadcasts' );
}
}, 10, 5 );
Need this built rather than just documented? See our services →