Skip to content

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

ParameterTypeDescription
$dataarray<string, mixed>
  tostringRecipient address(es).
  subjectstringSubject line.
  errorstringError message.
  codeintNumeric error code, `0` when the error carried none.
  log_idint|nullId of the email log entry, `null` when no row was written.
  connection_idint|nullId of the connection used, `null` when unknown.
  providerstringProvider of the connection used.
  sourcestringCode path that raised the failure: `wp_mail`, `api_queue`, `queue_exception`, ….

Fires in

Example

boolean_smtp_email_delivery_failed_final.php
add_action( 'boolean_smtp_email_delivery_failed_final', function ( array $data ) {
// React to the event.
}, 10, 1 );

Next steps