Clone
1
Events
Jonathan Miller edited this page 2026-05-13 01:21:39 +00:00

Supported Events

Core Plugin Events (plg_system_atscore)

These events are handled by the core system plugin out of the box.

Event Name Joomla Event Trigger
user.created onUserAfterSave New user registration
{context}.unpublished onContentChangeState Content unpublished (state=0)
{context}.trashed onContentChangeState Content trashed (state=-2)

Planned Component Events

JoomGallery (plg_joomgallery_atsticket)

  • joomgallery.image.pending — New image awaiting moderation
  • joomgallery.image.reported — Image reported by user
  • joomgallery.comment.pending — New comment awaiting moderation

Kunena (future)

  • kunena.post.reported — Forum post reported
  • kunena.user.banned — User banned from forums

Creating Custom Events

Any plugin can fire rules by calling the factory directly:

use Moko\AtsAutomation\AtsTicketFactory;

$factory = new AtsTicketFactory();
$factory->create([
    'catid'      => 37,  // Report a User
    'title'      => 'Custom event: something happened',
    'body'       => '<p>Details here...</p>',
    'created_by' => $userId,
    'origin'     => 'automation',
]);

Or use rule-based creation with placeholders:

// Load matching rules and fire them
$rules = $this->getMatchingRules('my.custom.event');
foreach ($rules as $rule) {
    $factory->createFromRule($rule, ['key' => 'value'], $userId);
}