# boolean_smtp_message_body

> Filters the message body immediately before it is sent.

Filter · Tier A · Since 1.0.0

Return a modified string to change what is sent.

## Signature

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `$body` | `string` | Message body (HTML or plain text, depending on content type). |
| `$to` | `string` | Primary recipient address. |

**Returns** `string` — The filtered body.

## Fires in

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

## Example

```php
add_filter( 'boolean_smtp_message_body', function ( string $body, string $to ) {
    return $body;
}, 10, 2 );
```
