Skip to content

jcohlmeyer/statamic-akismet

 
 

Repository files navigation

Use Akismet to stop spam

Latest Version Commercial License

This package provides an easy way stop submission spam via Akismet.

Requirements

  • PHP 7.4+
  • Statamic v3
  • Laravel 7+

Installation

You can install this package via composer using:

composer require silentz/akismet

The package will automatically register itself.

Configuration

.env

Set your Akismet API Key in your .env file. You can get it from: https://akismet.com/account/.

AKISMET_API_KEY=your-key-here

Permission

In order to manage your spam, you'll either have to be super user or have the manage spam permission:

[Permission

Settings

To publish the config file to config/akismet.php run:

php artisan vendor:publish --tag="akismet-config"

This will publish a file akismet.php in your config directory with the following contents:

return [

    'api_key' => env('AKISMET_API_KEY'),

    // these are the form handles you'd like to check for spam
    'forms' => [

        // the handle of your form
        'contact_us' => [

            // use `name_field` if you store both first and last name
            'name_field' => 'name',   // `name` in this case is the field in your form

            // use `first_name_field` & `last_name_field` if you store them separately
            'first_name_field' => 'first_name',
            'last_name_field' => 'last_name',
            'email_field' => 'email',
            'content_field' => 'message',
        ],
        'other_form' => [],
    ],
];

Usage

Create your Statamic forms as usual. When a submission is created it is checked for spam.

If it is spam, it gets put into that form's spam queue.

Spam Queues

From there you can discard (delete) it, or approve it. Approving it will put it back into the normal submissions and tell Akismet that it is not spam (to help with learning).

Approval/Discarding

If you find a submission that is spam, you can mark it as spam (image). This will put it in the spam queue and tell Akismet it is spam.

Mark As Spam

Testing

Run the tests with:

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

This is commercial software. You may use the package for your sites. Each site requires it's own license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 71.2%
  • Vue 18.6%
  • Blade 9.2%
  • JavaScript 1.0%