# boolean_smtp_resolve_routing_rule_connection

> Filters the connection a routing rule resolves for an outgoing message.

Filter · Tier A · Since 1.0.0

Return a connection array with at least an "id" key to route the message to that connection, or null to defer to the next resolution step.

## Signature

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$resolved` | `array{id: int}|null` | Connection data to route to, or null when no rule matched. |
| `$emailData` | `array<string, mixed>` | Routing data (to, subject, from, content_type). |

**Returns** `array{id: int}|null` — The connection to use, or `null` to fall back to the default resolution.

## Fires in

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

## Example

```php
add_filter( 'boolean_smtp_resolve_routing_rule_connection', function ( ?array $resolved, array $emailData ) {
    return $resolved;
}, 10, 2 );
```
