Skip to content

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

ParameterTypeDescription
$payloadarray<string, mixed>
  tostringRecipient address(es), comma separated.
  subjectstringSubject line.
  errorstringError message.
  codeintNumeric error code, `0` when the error carried none.
  log_idintId of the email log entry.
  connection_idint|nullId of the connection used, `null` when unknown.
  providerstringProvider of the connection used.

Fires in

Example

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

Next steps