boolean_smtp_queue_should_enqueue
Filters whether a message is queued for background delivery instead of being sent now.
filter Tier A Since 1.0.0
Consulted for every `wp_mail()` / `boolean_smtp_mail()` call. Return `true` to store the message and let the queue worker send it — bulk or newsletter mail, for example — while transactional mail keeps going out immediately. A queued call returns `true` to its caller as soon as the message is stored; the worker runs from WP-Cron within a minute (or at once with `wp boolean-smtp queue:work`).
Signature
add_filter( 'boolean_smtp_queue_should_enqueue', $callback, 10, 2 );Parameters
| Parameter | Type | Description |
|---|---|---|
$enqueue | bool | Whether to queue the message. Default `false`. |
$atts | array<string, mixed> | The `wp_mail()` arguments: `to`, `subject`, `message`, `headers`, `attachments`, and `embeds` when given. |
Returns bool — Whether to queue the message.
Fires in
app/Support/BooleanSmtpWpMail.php:148—BooleanSmtp\Support\BooleanSmtpWpMail::shouldEnqueue()
Example
add_filter( 'boolean_smtp_queue_should_enqueue', function ( bool $enqueue, array $atts ) { return $enqueue;}, 10, 2 );Next steps
- Mail pipeline — every hook in this area, in firing order where that applies.
- Hook Explorer — filter and search every hook.