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

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

- Page: https://pluginprobe.com/plugins/fluentform/3.6.22/code/app/Services/Integrations/Slack/SlackNotificationActions.php
- Raw: https://pluginprobe.com/plugins/fluentform/3.6.22/raw/app/Services/Integrations/Slack/SlackNotificationActions.php
- Modified: 2020-06-19T11:01:22+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/3.6.22/code/app/Services/Integrations/Slack/SlackNotificationActions.php#L10-L20`.

```php
<?php

namespace FluentForm\App\Services\Integrations\Slack;

use FluentForm\App\Helpers\Helper;
use FluentForm\Framework\Foundation\Application;

class SlackNotificationActions
{
    protected $app = null;

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

    public function register()
    {
        $isEnabled = Helper::isSlackEnabled();
        if ($isEnabled) {
            add_filter('fluentform_global_notification_active_types', function ($types) {
                $types['slack'] = 'slack';
                return $types;
            });
            add_action('fluentform_integration_notify_slack', array($this, 'notify'), 20, 4);
        }
    }

    public function notify($feed, $formData, $entry, $form)
    {
        $response = Slack::handle($feed, $formData, $form, $entry);
        if($response['status'] === 'success') {
            do_action('ff_log_data', [
                'parent_source_id' => $form->id,
                'source_type' => 'submission_item',
                'source_id' => $entry->id,
                'component' => 'slack',
                'status' => 'success',
                'title' => $feed['meta_key'],
                'description' => 'Slack feed has been successfully initialed and pushed data'
            ]);
        }else {
            do_action('ff_log_data', [
                'parent_source_id' => $form->id,
                'source_type' => 'submission_item',
                'source_id' => $entry->id,
                'component' => 'slack',
                'status' => 'failed',
                'title' => $feed['meta_key'],
                'description' => $response['message']
            ]);
        }
    }
}

```
