Notifier for Craft is a plugin that provides Airbrake notifications to Codebase and/or Airbrake.io.
- Copy the included
notifier
directory intocraft/plugins
. - Use Composer to install the required libraries:
curl -s http://getcomposer.org/installer | php
php composer.phar install
- Navigate to the Plugins settings in the CP and install Notifier.
- Add the URL to the Codebase or Airbrake.io notifier and the necessary API key.
You can use Notifier in your plugins or in your templates.
You can send notifications to Notifier using the sendToNotifier hook:
craft()->plugins->call('sendToNotifier', array('The message...'));
Notifier can be used in templates to send notifications when someone tries to access an invalid page, or when the template can't find the content it should.
{% if craft.entries.section('blog') | length == 0 %}
craft.notifier.notify('No blog posts were found.')
{% endif %}
- Support for Slack notifications