benecaster_count_email_log()
benecaster_count_email_log( array $args = [] ): int
Counts the email log rows that match the same filters as benecaster_get_email_log(), for paging through them. Every status is counted, held and expired included.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
args |
array |
[] |
No | The filters benecaster_get_email_log() takes: email_type, show_id (0 for email that belongs to no show), user_id, date_from and date_to. limit and offset are ignored. |
Return Value
Type:
int
How many email log rows match. 0 when none do or a filter is malformed.
Example
$filters = [ 'show_id' => $show_id ];
$total = benecaster_count_email_log( $filters );
$pages = (int) ceil( $total / 50 );
$rows = benecaster_get_email_log( $filters + [ 'limit' => 50, 'offset' => ( $page - 1 ) * 50 ] );
Notes
A malformed filter returns 0 and raises a _doing_it_wrong() notice. There is no capability check.
Need this built rather than just documented? See our services →