Kentaro Kuribayashi's blog

Software Engineering, Management, Books, and Daily Journal.

Hato: A Tool to Manage Various Notification Methods

Hato is a tool to manage various notification methods. Once you configure notification methods, you can send messages via the methods just by posting them to Hato.


Launch Hato with hato command:

$ hato -c config.rb

Then, post your notification message:

$ curl -d 'message=test' -d 'tag=test' -d 'api_key=test' http://localhost:9699/notify


Hato provides DSLs for configuration.

e.g. config.rb:

Hato::Config.define do
  api_key 'test'
  host    ''
  port    9699

  tag 'test' do
    plugin 'Ikachan' do
      scheme  'http'
      host    ''
      port    4979
      channel 'hato'

    plugin 'Mail' do
      smtp address:   '',
           port:      587,
           domain:    'example',
           user_name: 'hato',
           password:  'password',
           enable_ssl: true

      subject_template = <<EOS
[<%= args[:tag] %>] Notification
      body_template = <<EOS
You've got a message:

<%= args[:message] %>

      message from: '',
              to:   [
              subject_template: subject_template,
              body_template:    body_template

Plugin Architecture

Hato bundles several plugins by default:

You can easily extend Hato by creating your own plugins. See the source for detail. It's really easy.

Using Hato with Thrid-party Plugins

At first, create a Gemfile to manage dependencies:

source ''

gem 'hato'
gem 'hato-plugin-awesome_plugin'

Then, execute bundle exec hato -c your_config_file