# boolean_smtp_test_email_sent

> Fires after the admin test-email tool has attempted a send.

Action · Tier A · Since 1.0.0

Fires whether the send succeeded or failed; a simulated send (simulation mode on) reports `success` true with the simulation as its provider.

## Signature

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$result` | `array<string, mixed>` |  |
| &nbsp;&nbsp;`to` | `string` | Recipient address. |
| &nbsp;&nbsp;`subject` | `string` | Subject line. |
| &nbsp;&nbsp;`connection_id` | `int|null` | Id of the connection used, `null` when none was resolved. |
| &nbsp;&nbsp;`success` | `bool` | Whether the message was accepted for delivery. |
| &nbsp;&nbsp;`error` | `string|null` | Failure message, `null` on success. |
| &nbsp;&nbsp;`elapsed_ms` | `int` | Time the attempt took, in milliseconds. |

## Fires in

- [app/Http/Controllers/TestEmailController.php:160](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Http/Controllers/TestEmailController.php#L160) — `BooleanSmtp\Http\Controllers\TestEmailController::send()`

## Example

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