Hooking into an event in Blesta consists of merely filling in a stubbed callback method, or returning an array from a plugin's getEvents() method. Blesta offers a number of events that are automatically triggered when needed. These events may be found in the /installdir/components/events/ directory.
In some cases, for example when writing a plugin, you may wish to execute a custom event within the scope of your plugin. For instance, if your plugin allows for the creation of invoices, you may wish to execute an event when an invoice is created. For details on custom events see the Creating Events section of this manual.
Events
Event | Triggered When | Default Event Handler | Parameters | Returns | Since |
---|---|---|---|---|---|
Appcontroller.preAction | A URI is requested | EventsAppControllerCallback::preAction() | void | void | 3.0 |
Clients.create | A client is created | EventsClientsCallback::create() |
| void | 3.1 |
Emails.send | An email template is sent | EventsEmailsCallback::send() |
| array Key/value pairs to merge with tags. | 3.1 |
Emails.sendCustom | A non-template based email is sent | EventsEmailsCallback::sendCustom() |
| array Key/value pairs to merge with tags. | 3.1 |
Users.login | A user logs in | EventsUsersCallback::login() |
| void | 3.1 |
Users.logout | A user logs out | EventsUsersCallback::logout() |
| void | 3.1 |
Navigation.getSearchOptions | Staff search options are displayed | EventsNavigationCallback::getSearchOptions() |
| void | 3.0 |