Skip to main content

benecaster_get_email_opt_outs()

Utilities Free
benecaster_get_email_opt_outs( int $show_id ): array

Everyone opted out of a show’s email right now. This is the state sending obeys, so someone who opted back in is not listed, and neither is a deleted account. See Add a show’s email opt-outs and broadcast history to the data export.

Parameters

Name Type Default Required Description
show_id int — Yes The show whose opt-outs to read.

Return Value

Type: array

One row per person per level, in ascending user ID, so someone opted out of both broadcast and all has two rows: user_id, email (the account's current address), show_id, scope (broadcast, episode_notifications or all), opted_out_at (UTC, or null when none was stored).

Example

foreach ( benecaster_get_email_opt_outs( $show_id ) as $opt_out ) {
    $rows[] = [ $opt_out['email'], $opt_out['scope'], $opt_out['opted_out_at'] ];
}

Notes

There is no capability check, and rows carry email addresses: check manage_options, or your own capability, before showing them.

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