# Route Fluent Forms Notifications by Department

> Sends Fluent Forms email notifications to a different inbox depending on the department or topic chosen in the form.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: fluent-forms, notifications, routing
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/fluentforms-route-by-department/

## Code

```php
$wpide_ff_route_field = 'department';
$wpide_ff_routes      = array(
    // 'sales'   => 'sales@yourdomain.com',
    // 'support' => 'support@yourdomain.com',
);

add_filter( 'fluentform/email_to', function ( $address, $notification, $data ) use ( $wpide_ff_route_field, $wpide_ff_routes ) {
    $choice = isset( $data[ $wpide_ff_route_field ] ) && is_string( $data[ $wpide_ff_route_field ] ) ? $data[ $wpide_ff_route_field ] : '';

    return isset( $wpide_ff_routes[ $choice ] ) && is_email( $wpide_ff_routes[ $choice ] ) ? $wpide_ff_routes[ $choice ] : $address;
}, 10, 3 );
```

## Notes

Set the field name and add each option value with its address to the map at the top; Fluent Forms Pro also has conditional routing in the notification settings.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Route Fluent Forms Notifications by Department" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
