Forum

Thread tagged as: Suggestions, Add-on-development

Event Hooks Feature Request

Following some recent discussion on the Perchology Slack channel. I’ve been encouraged to re-submit some requests for Event Hooks. They have been mentioned in the forum previously but perhaps not in the feature request channel.

  1. An event hook that fires when a Runway backup task has completed.

At present Runway backup “fails silently” in that if you don’t actively go and look at the results you don’t know you have got problems. This hook will allow app developers to implement notification functionality (email, Pushover, PageDuty, etc).

  1. An event hook that fires when a form has been processed.

A typical use would be to add tasks/contacts/etc to CRM systems and alike. Although Forms can be submitted to multiple apps this is effectively a parallel operation and what is needed is a sequence so that only form submissions that have passed spam checking etc are processed further. I guess there is a question about this hook being before or after email. My preference is before but it’s not a show stopper either way.

  1. An event hook that fires when a user login been completed

The most important use of this would be to allow second factor authentication which is becoming more important and common. Would also be useful for audit purposes and for providing information on login about recent changes.

Kevin Jackson

Kevin Jackson 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Thanks for these.

An event hook that fires when a form has been processed.

Do you mean the Forms app, or forms in general? The ability to template, display, validate and receive a raw form submission is handled by Perch. Sending emails etc is down to the app that is set as the recipient for that form submission (such as Forms).

Runway back-up is a great feature so any enhancements to that get my vote!

Anything that will allow two factor authentication gets my vote.

These get my vote too. Anything that would allow us to leverage the validation of the forms app and then carry out additional processing would really useful.

Backup event is a must as well i think.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Backup event (backup.run) is done.

Anything that would allow us to leverage the validation of the forms app and then carry out additional processing would really useful.

The Forms app doesn't have any validation - that's part of Perch core.

Drew McLellan

Drew McLellan 2638 points
Perch Support

An event hook that fires when a user login been completed

There's already a user.login event. Is that not sufficient?

Drew

user.login is not listed in the docs at https://docs.grabaperch.com/api/events/list/. Am I missing something?

The forms one is not about validation, it's to allow further processing of form data when a form has sucessfully been processed and saved to the database.

Thanks

Kevin

Drew McLellan

Drew McLellan 2638 points
Perch Support

Am I missing something?

No, it wasn't listed, but I've added it for the next docs build.

You can always listen to see what events are being fired around the event you're interested in:

$API->on('*', function(PerchSystemEvent $Event){
    // An event has been fired
    // It was: $Event->event
});
Drew McLellan

Drew McLellan 2638 points
Perch Support

I've added perch_forms.received to the Forms app for a future release.

Drew

Many thanks.

Is there anything special with the user.login hook? Using a wildcard listner I'm able to see all the admin hooks fire and the runtime page.publish but not user.login.

Kevin

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ah, yeah. That's not going to work as it's fired before your listener is registered. I'll give it some thought.