Creating an event handler in Blesta consists of merely filling in a stubbed callback method, or returning an array of callbacks from a plugin's getEvents() method. Blesta offers a number of events that are automatically triggered when needed. The default handlers for these events may be found in the /installdir/components/events/default/ directory. You can paste your event handler code directly into any of the default handler methods, or more preferably, create a plugin to handle the event.
Events
Info | ||
---|---|---|
| ||
Any plugin can register an event handler. To see how, check out the Plugin Events section of this manual. |
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 |
Invoices.add | An invoice is created | EventsInvoicesCallback::add() |
| void | 3.1 |
Invoices.edit | An invoice is updated | EventsInvoicesCallback::edit() |
| void | 3.1 |
Invoices.setClosed | An invoice is closed | EventsInvoicesCallback::setClosed() |
| void | 3.1 |
Transactions.add | A transaction is created | EventsTransactionsCallback::add() |
| void | 3.1 |
Transactions.edit | A transaction is updated | EventsTransactionsCallback::edit() |
| void | 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 |
...