# boolean_smtp_queue_batch_size

> Filters how many queued messages one worker run sends.

Filter · Tier B · Since 1.0.0

The worker runs from WP-Cron when a message is queued or a retry is due, and from `wp boolean-smtp queue:work`; each run sends up to this many messages, oldest first, and arms another run while rows remain.

## Signature

```php
add_filter( 'boolean_smtp_queue_batch_size', $callback, 10, 1 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$size` | `int` | Messages per run. Default `50`. |

**Returns** `int` — Messages per run.

## Fires in

- [app/Services/Queue/QueueScheduler.php:100](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Services/Queue/QueueScheduler.php#L100) — `BooleanSmtp\Services\Queue\QueueScheduler::batchSize()`

## Example

```php
add_filter( 'boolean_smtp_queue_batch_size', function ( int $size ) {
    return $size;
}, 10, 1 );
```
