boolean_smtp_email_delivery_failed_final
Fires when a mail delivery attempt has failed with no further fallback to try.
action Tier A Since 1.0.0
The hook to build failure alerts on: unlike `boolean_smtp_email_failed`, which fires for every failed attempt, this fires once per message, after the fallback connection has also failed or been skipped, and not at all when `boolean_smtp_should_notify_delivery_failure` returned `false`.
Signature
add_action( 'boolean_smtp_email_delivery_failed_final', $callback, 10, 1 );Parameters
| Parameter | Type | Description |
|---|---|---|
$data | array<string, mixed> | |
to | string | Recipient address(es). |
subject | string | Subject line. |
error | string | Error message. |
code | int | Numeric error code, `0` when the error carried none. |
log_id | int|null | Id of the email log entry, `null` when no row was written. |
connection_id | int|null | Id of the connection used, `null` when unknown. |
provider | string | Provider of the connection used. |
source | string | Code path that raised the failure: `wp_mail`, `api_queue`, `queue_exception`, …. |
Fires in
app/Services/Mailer/EmailDeliveryFailureNotifier.php:96—BooleanSmtp\Services\Mailer\EmailDeliveryFailureNotifier::notifyFinal()app/Services/Mailer/EmailDeliveryFailureNotifier.php:139—BooleanSmtp\Services\Mailer\EmailDeliveryFailureNotifier::notifyFinalFromQueueLog()
Example
add_action( 'boolean_smtp_email_delivery_failed_final', function ( array $data ) { // 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.