Needs review
Project:
Spambot
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2025 at 21:38 UTC
Updated:
3 Jun 2026 at 18:46 UTC
Jump to comment: Most recent
I would like to be able to execute some of my own code when spam is detected.
It would be useful if there was an event dispatched that custom modules could subscribe to.
I will try to add a MR
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
loze commentedThere is the hook
spambot_registration_blockedthat is invoked on both user registration and webform submissions.But no hook is triggered when spam is detected on a cron run.
Comment #3
nickdickinsonwildeSounds like a great idea. I see a branch, but I don't see any commits there. can you try again?
Comment #5
loze commentedThe MR adds a new event
Drupal\spambot\Event\SpamDetectedEventwhich is dispatched from
spambot_cron()The event carries the detected account, available via
getAccount(), so custom modules can subscribe and run their own code: