Events Reference

To learn more about how events work, see the Craft documentation on events (opens new window).

onBeforeSaveSubmission

Raised before an editor submits an entry for approval. Event handlers can prevent the submission from getting sent by setting $event->performAction to false.

Params:

craft()->on('comments.onBeforeSaveSubmission', function($event) {
    $submission = $event->params['submission'];
    $event->performAction = false;
});

onSaveSubmission

Raised after an editor submits an entry for approval.

Params:

craft()->on('comments.onSaveSubmission', function($event) {
    $submission = $event->params['submission'];
});

onBeforeApproveSubmission

Raised before a publisher approves an entry. Event handlers can prevent the submission from being approved by setting $event->performAction to false.

Params:

craft()->on('comments.onBeforeApproveSubmission', function($event) {
    $submission = $event->params['submission'];
    $event->performAction = false;
});

onApproveSubmission

Raised after a publisher has approved an entry.

Params:

craft()->on('comments.onApproveSubmission', function($event) {
    $submission = $event->params['submission'];
});

Previous ← Submission Model Next Roadmap →

Get started with Workflow

Available for Craft 4. Get it from the plugin store.