# boolean_smtp_oauth_refresh_failed

> Fires after an OAuth token refresh fails, once retries are exhausted.

Action · Tier A · Since 1.0.0

Listened to by {@see \BooleanSmtp\Providers\MailServiceProvider::onOAuthRefreshFailed()} to send a failure notification.

## Signature

```php
add_action( 'boolean_smtp_oauth_refresh_failed', $callback, 10, 1 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$data` | `array{
    connection_id: int, driver: string, error_code: string,
    error_message: string, attempts: int, response_time_ms: int, recoverable: bool
}` | Failure details. |

## Fires in

- [app/Jobs/OAuthRefreshJob.php:258](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Jobs/OAuthRefreshJob.php#L258) — `BooleanSmtp\Jobs\OAuthRefreshJob::handle()`

## Example

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