boolean_smtp_mail_validate
Filters whether a message should be rejected before it is processed further.
filter Tier A Since 1.0.0
Return an error object (see {@see \BooleanSmtp\Adapters\Contracts\ErrorHandlerAdapterContract}) to reject the message and fail the send; return null to let it continue.
Signature
add_filter( 'boolean_smtp_mail_validate', $callback, 10, 2 );Parameters
| Parameter | Type | Description |
|---|---|---|
$validation | mixed | Null to continue, or an error object naming the rejection reason. |
$atts | array<string, mixed> | wp_mail-style arguments being validated. |
Returns mixed — A `WP_Error` to reject the message, `true` to accept it, or `null` to run the built-in validation.
Fires in
app/Services/Mailer/BooleanSmtpMailPipeline.php:91—BooleanSmtp\Services\Mailer\BooleanSmtpMailPipeline::send()
Example
add_filter( 'boolean_smtp_mail_validate', function ( $validation, array $atts ) { return $validation;}, 10, 2 );Next steps
- Mail pipeline — every hook in this area, in firing order where that applies.
- Hook Explorer — filter and search every hook.