Skip to main content

benecaster_email_resubscribed

Action Free Since v1.0.0

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 The opt-in level being restored: 'broadcast' or 'all'
$email_address string Email address that resubscribed

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 );