---
title: "modal_kit_pro_providers – Modal Kit Docs"
description: "Add your own form destination to the Form block’s Send to list, posted from the browser or relayed through your site."
language: "en-US"
canonical_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/"
source_url: "https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/"
content_type: "text/markdown"
---

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

Hooks ▾

[All hooks](https://modalkitwp.com/docs/hooks/)

Free · PHP hooks

[modal_kit_layouts](https://modalkitwp.com/docs/hooks/modal_kit_layouts/)

[modal_kit_styles](https://modalkitwp.com/docs/hooks/modal_kit_styles/)

[modal_kit_theme_tokens](https://modalkitwp.com/docs/hooks/modal_kit_theme_tokens/)

[modal_kit_meta_schema](https://modalkitwp.com/docs/hooks/modal_kit_meta_schema/)

[modal_kit_targets_request](https://modalkitwp.com/docs/hooks/modal_kit_targets_request/)

[modal_kit_dialog_context](https://modalkitwp.com/docs/hooks/modal_kit_dialog_context/)

[modal_kit_dialog_panel](https://modalkitwp.com/docs/hooks/modal_kit_dialog_panel/)

[modal_kit_button_actions](https://modalkitwp.com/docs/hooks/modal_kit_button_actions/)

[modal_kit_render_button_action](https://modalkitwp.com/docs/hooks/modal_kit_render_button_action/)

[modal_kit_link_prefix](https://modalkitwp.com/docs/hooks/modal_kit_link_prefix/)

[modal_kit_close_label](https://modalkitwp.com/docs/hooks/modal_kit_close_label/)

[modal_kit_post_type_capabilities](https://modalkitwp.com/docs/hooks/modal_kit_post_type_capabilities/)

[modal_kit_pattern_categories](https://modalkitwp.com/docs/hooks/modal_kit_pattern_categories/)

[modal_kit_pattern_collections](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collections/)

[modal_kit_pattern_collection_types](https://modalkitwp.com/docs/hooks/modal_kit_pattern_collection_types/)

[modal_kit_starter_settings](https://modalkitwp.com/docs/hooks/modal_kit_starter_settings/)

[modal_kit_backdrop_capability](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_capability/)

[modal_kit_backdrop_request](https://modalkitwp.com/docs/hooks/modal_kit_backdrop_request/)

[modal_kit_optimizer_paths](https://modalkitwp.com/docs/hooks/modal_kit_optimizer_paths/)

[modal_kit_pro_listings](https://modalkitwp.com/docs/hooks/modal_kit_pro_listings/)

Pro · PHP hooks

[modal_kit_pro_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_providers/)

[modal_kit_pro_captcha_providers](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[modal_kit_pro_captcha_hostnames](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_hostnames/)

[modal_kit_pro_country](https://modalkitwp.com/docs/hooks/modal_kit_pro_country/)

[modal_kit_pro_country_sources](https://modalkitwp.com/docs/hooks/modal_kit_pro_country_sources/)

[modal_kit_pro_results_goal](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_goal/)

[modal_kit_pro_results_count](https://modalkitwp.com/docs/hooks/modal_kit_pro_results_count/)

[modal_kit_pro_coupon_issued](https://modalkitwp.com/docs/hooks/modal_kit_pro_coupon_issued/)

[modal_kit_pro_visitor_address](https://modalkitwp.com/docs/hooks/modal_kit_pro_visitor_address/)

[modal_kit_pro_play_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_play_rate_limit/)

[modal_kit_pro_form_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[modal_kit_pro_address_daily_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

[modal_kit_pro_events_rate_limit](https://modalkitwp.com/docs/hooks/modal_kit_pro_events_rate_limit/)

[modal_kit_pro_modal_events_per_hour](https://modalkitwp.com/docs/hooks/modal_kit_pro_modal_events_per_hour/)

Pro · Updates

[modal_kit_pro_is_staging](https://modalkitwp.com/docs/hooks/modal_kit_pro_is_staging/)

[modal_kit_pro_pre_rollback](https://modalkitwp.com/docs/hooks/modal_kit_pro_pre_rollback/)

[modal_kit_pro_tested_up_to](https://modalkitwp.com/docs/hooks/modal_kit_pro_tested_up_to/)

Editor filters · JavaScript

[modalKit.layouts](https://modalkitwp.com/docs/hooks/modalkit-layouts/)

[modalKit.triggerTypes](https://modalkitwp.com/docs/hooks/modalkit-triggertypes/)

[modalKit.triggerMenuGroups](https://modalkitwp.com/docs/hooks/modalkit-triggermenugroups/)

[modalKit.buttonActions](https://modalkitwp.com/docs/hooks/modalkit-buttonactions/)

[modalKit.canvasChrome](https://modalkitwp.com/docs/hooks/modalkit-canvaschrome/)

[modalKit.styleTarget](https://modalkitwp.com/docs/hooks/modalkit-styletarget/)

[modalKit.settingsTabs](https://modalkitwp.com/docs/hooks/modalkit-settingstabs/)

[modalKit.styleEditor](https://modalkitwp.com/docs/hooks/modalkit-styleeditor/)

[modalKit.toolsRows](https://modalkitwp.com/docs/hooks/modalkit-toolsrows/)

[modalKit.pickerPreview](https://modalkitwp.com/docs/hooks/modalkit-pickerpreview/)

[Docs](https://modalkitwp.com/docs/) / [Hooks](https://modalkitwp.com/docs/hooks/) / Pro · PHP hooks

# `modal_kit_pro_providers`

filter

Pro

PHP

Add your own form destination to the Form block’s Send to list, posted from the browser or relayed through your site.

Builds the list of form destinations: the email services, the webhook and the WordPress plugins Pro sends to. Each item is an object that extends `ModalKit\Pro\Providers\Provider`. Add one and it appears under **Send to** in the Form block and on **Modal Kit → Settings → Integrations**.

A provider does one of two things. It gives the browser a public address to post to (transport `post`), or it returns transport `relay` with no address, so the browser hands the entry to your site and the site calls the provider’s `send()`. `public_config()` is printed in the page, so secrets only ever belong in `send()`.

The list is built the first time Pro needs it in a request, then kept for the rest of that request.

## Parameters

Parameter

Description

`$list`

Provider[]

The built-in providers, in the order the settings list them.

## Returns

`Provider[]` The providers. Anything that isn’t a `Provider` is dropped, and a later provider with the same `id()` replaces an earlier one.

## Examples

### A CRM, sent from your site

The browser sends the entry to your site, which posts it to the CRM’s API with a key entered on **Settings → Integrations**. The key never reaches the page.

PHP

```
add_filter( 'modal_kit_pro_providers', function ( $providers ) {
  $providers[] = new class() extends \ModalKit\Pro\Providers\Provider {
    public function id() {
      return 'acme-crm';
    }

    public function label() {
      return __( 'Acme CRM', 'my-plugin' );
    }

    // Asks for an API key on Settings → Integrations.
    public function needs_key() {
      return true;
    }

    // Sent from the site, so it needs live WordPress.
    public function needs_live_site() {
      return true;
    }

    // What the page may see: no address, so the
    // browser hands the entry to your site.
    public function public_config( $form ) {
      return array(
        'url'       => '',
        'transport' => 'relay',
        'email'     => 'email',
      );
    }

    // $fields are keyed by each Field block's name.
    public function send( $form, $fields, $tags ) {
      $result = $this->api_json(
        'POST',
        'https://api.acme.example/v1/contacts',
        array( 'Authorization' => 'Bearer ' . $this->key() ),
        array(
          'email' => $fields['email'] ?? '',
          'name'  => $fields['name'] ?? '',
          'tags'  => $tags,
        )
      );

      if ( is_wp_error( $result ) ) {
        return $result;
      }

      if ( $result['code'] < 200 || $result['code'] >= 300 ) {
        return self::rejected( $result );
      }

      return true;
    }
  };

  return $providers;
} );
```

### A public endpoint the browser posts to

For a service whose form endpoint accepts posts from other sites, like an embedded form’s `action`. A non-empty `embedHelp` adds a **Form address** box to the Form block; only addresses on the service’s own host are used. The endpoint must answer with CORS headers, or the browser treats the post as failed.

PHP

```
add_filter( 'modal_kit_pro_providers', function ( $providers ) {
  $providers[] = new class() extends \ModalKit\Pro\Providers\Provider {
    public function id() {
      return 'acme-forms';
    }

    public function label() {
      return __( 'Acme Forms', 'my-plugin' );
    }

    // emailKey must match 'email' in public_config().
    public function ui() {
      return array(
        'emailKey'  => 'contact[email]',
        'embedHelp' => __(
          'Paste the form address from Acme’s embed code.',
          'my-plugin'
        ),
      ) + parent::ui();
    }

    public function public_config( $form ) {
      $url  = esc_url_raw( (string) ( $form['actionUrl'] ?? '' ) );
      $safe = 'https' === wp_parse_url( $url, PHP_URL_SCHEME )
        && 'forms.acme.example' === wp_parse_url( $url, PHP_URL_HOST );

      return array(
        'url'       => $safe ? $url : '',
        'transport' => 'post',
        'email'     => 'contact[email]',
        'tagsField' => 'tags[]',
      );
    }
  };

  return $providers;
} );
```

Good to know

**Must implement:** `id()` (lower-case letters, digits and dashes; it’s stored in the block and used in REST routes), `label()` and `public_config( $form )`, which returns `url`, `transport` (`post` or `relay`) and `email` (the email field’s name), plus optional `tagsField` (one entry per tag) and `extra` (fixed fields the browser adds).

**May implement:** `send( $form, $fields, $tags )` (by default it posts the fields form-encoded to `public_config()`’s `url`), `group()` (`service`, `plugin` or `webhook`: the Send to heading; any other value hides it), `needs_key()`, `credential_fields()`, `verify_key()` or `verify_credentials()` (checked before the key is saved), `forget()`, `ui()` (`emailKey`, `listLabel`, `tags`, `note`, `embedHelp`, `keyHelp`, `keyNote`, `alias`), `lists()` and `tags()` (each `array( array( id, label ) )`, or a `WP_Error`), `needs_live_site()`, `connected()`, `detail()` and `settings_link()`. Set `$this->sent` in `send()` to change “HTTP 200” in the Submissions log.

Helpers for `send()`: `$this->key()` and `$this->credentials()` read what was saved on the Integrations tab, `api_json()` and `api_get()` make requests, `self::check_response()` and `self::rejected()` turn answers into errors, `person( $fields )` finds email and names, and `cached()` keeps `lists()` for ten minutes.

`send()` runs for relayed entries (`POST modal-kit-pro/v1/submit`) and for **Send a test submission** in the editor, which sends only the email field. It returns `true` or a `WP_Error`; an error is logged in Submissions and the visitor sees the form’s failure message. `$fields` are plain text, keyed by each Field block’s name, with the email under the provider’s email key and hidden fields included; ticked tag checkboxes arrive in `$tags`.

A `post` provider is still relayed when the form has a bot check or **Also send to** a webhook, and then its `send()` runs on the site. The default `send()` doesn’t add `extra`, so override it if your endpoint needs those fields.

In a must-use plugin, build the class inside the callback, as above. A named class at the top of the file would load before Pro and fail, because the base class doesn’t exist yet.

Applied in `modal-kit-pro/includes/Integrations.php`.

Related

[`modal_kit_pro_captcha_providers`](https://modalkitwp.com/docs/hooks/modal_kit_pro_captcha_providers/)

[`modal_kit_pro_form_daily_limit`](https://modalkitwp.com/docs/hooks/modal_kit_pro_form_daily_limit/)

[`modal_kit_pro_address_daily_limit`](https://modalkitwp.com/docs/hooks/modal_kit_pro_address_daily_limit/)

## Need a hook that isn’t here?

[Ask us](https://modalkitwp.com/support/)

[Developers overview](https://modalkitwp.com/developers/)
