# boolean_smtp_resolve_connection

> Filters the connection resolved for an outgoing message, after routing rules and sender matching have run.

Filter · Tier A · Since 1.0.0

Return a connection array with a different "id" to redirect the send to that connection.

## Signature

```php
add_filter( 'boolean_smtp_resolve_connection', $callback, 10, 2 );
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$connectionArray` | `array<string, mixed>` | Resolved connection, from {@see Connection::toArray()}. |
| `$emailData` | `array<string, mixed>` | Routing data (to, subject, from, content_type). |

**Returns** `array<string, mixed>` — The filtered connection data.

## Fires in

- [app/Services/Mailer/MailerManager.php:1097](https://github.com/booleanpress/boolean-smtp-src/blob/main/app/Services/Mailer/MailerManager.php#L1097) — `BooleanSmtp\Services\Mailer\MailerManager::applyResolveConnectionFilter()`

## Example

```php
add_filter( 'boolean_smtp_resolve_connection', function ( array $connectionArray, array $emailData ) {
    return $connectionArray;
}, 10, 2 );
```
