boolean_smtp_email_failed
Fires after a send attempt has failed, before the fallback connection is tried.
action Tier A Since 1.0.0
Fires for every failed attempt, so it can fire and the message still be delivered by the fallback connection; build failure alerts on `boolean_smtp_email_delivery_failed_final` instead. The payload has passed through `boolean_smtp_email_event_data`.
Signature
add_action( 'boolean_smtp_email_failed', $callback, 10, 1 );Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, mixed> | |
to | string | Recipient address(es), comma separated. |
subject | string | Subject line. |
error | string | Error message. |
code | int | Numeric error code, `0` when the error carried none. |
log_id | int | Id of the email log entry. |
connection_id | int|null | Id of the connection used, `null` when unknown. |
provider | string | Provider of the connection used. |
Fires in
app/Services/Mailer/EmailLogSendLifecycle.php:251—BooleanSmtp\Services\Mailer\EmailLogSendLifecycle::onWpMailFailed()
Example
add_action( 'boolean_smtp_email_failed', function ( array $payload ) { // React to the event.}, 10, 1 );Next steps
- Delivery lifecycle — every hook in this area, in firing order where that applies.
- Hook Explorer — filter and search every hook.