# fluentform/6.2.2/app/Services/Integrations/Slack/SlackNotificationActions.php

Fluent Forms – Customizable Contact Forms, Survey, Quiz, &amp; Conversational Form Builder, version 6.2.2. 57 lines.

- Page: https://pluginprobe.com/plugins/fluentform/6.2.2/code/app/Services/Integrations/Slack/SlackNotificationActions.php
- Raw: https://pluginprobe.com/plugins/fluentform/6.2.2/raw/app/Services/Integrations/Slack/SlackNotificationActions.php
- Modified: 2026-04-01T13:33:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluentform/6.2.2/code/app/Services/Integrations/Slack/SlackNotificationActions.php#L10-L20`.

```php
<?php

namespace FluentForm\App\Services\Integrations\Slack;

defined('ABSPATH') or die;

use FluentForm\App\Helpers\Helper;
use FluentForm\Framework\Foundation\Application;
use FluentForm\Framework\Helpers\ArrayHelper as Arr;

class SlackNotificationActions
{
    protected $app = null;

    public function __construct(Application $app)
    {
        $this->app = $app;
//        add_filter('fluentform/notifying_async_slack', '__return_false');
    }

    public function register()
    {
        add_filter('fluentform/global_notification_active_types', function ($types) {
            $isEnabled = Helper::isSlackEnabled();
            if ($isEnabled) {
                $types['slack'] = 'slack';
            }
            return $types;
        });
        add_action('fluentform/integration_notify_slack', [$this, 'notify'], 20, 4);
        add_filter('fluentform/get_meta_key_settings_response', function ($response, $formId, $key) {
            if ('slack' == $key) {
                $formApi = fluentFormApi()->form($formId);
                $response['formattedFields'] = array_values($formApi->labels());
            }

            return $response;
        }, 10, 3);
    }

    public function notify($feed, $formData, $entry, $form)
    {
        $isEnabled = Helper::isSlackEnabled();
        if (! $isEnabled) {
            return;
        }
        $response = Slack::handle($feed, $formData, $form, $entry);
        if ('success' === Arr::get($response, 'status')) {
            do_action('fluentform/integration_action_result', $feed, 'success',
                __('Slack feed has been successfully initialed and pushed data', 'fluentform'));
        } else {
            $error = Arr::get($response, 'message');
            do_action('fluentform/integration_action_result', $feed, 'failed', $error);
        }
    }
}

```
