# boolean_smtp_connection_saved

> Fires after a connection has been written to the database, wherever the write came from.

Action · Tier A · Since 1.0.0

Fires for the admin UI, the settings importer, the migration from another plugin, the Pro one-click flows and the OAuth token refresh alike — every path goes through the connection repository. `boolean_smtp_connection_created` and `boolean_smtp_connection_updated` are the admin UI's own events and fire only there. The connection's credentials are encrypted at rest; decrypt `$connection->settings` through the encryptor contract if you need them.

## Signature

```php
add_action( 'boolean_smtp_connection_saved', $callback, 10, 2 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$connection` | `\BooleanSmtp\Models\Connection` | The connection as stored. |
| `$created` | `bool` | True when the row was just created, false when it was updated. |

## Fires in

- [app/Repositories/ConnectionRepository.php:189](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Repositories/ConnectionRepository.php#L189) — `BooleanSmtp\Repositories\ConnectionRepository::announceSaved()`

## Example

```php
add_action( 'boolean_smtp_connection_saved', function ( \BooleanSmtp\Models\Connection $connection, bool $created ) {
    // React to the event.
}, 10, 2 );
```
