MultiNotifier provides a minimal, modular and adaptable interface for sending notifications in Ruby. It unifies and distills the API for sending notifications to multiple sources with middlewares.
Add this line to your application's Gemfile:
gem 'multi_notifier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install multi_notifier
MultiNotifier.build do |builder|
builder.use :mail, :from => "from@owenou.com", :to => "to@owenou.com", :subject => "MultiNotifier notification"
builder.use :campfire, :access_token => "123", :room => "123", :message => "Hello world"
end.notify_all!
The mail middleware sends email with the provided settings.
builder.adapter :mail,
:delivery => {
:method => Rails.configuration.action_mailer.delivery_method, # delivery method
:settings => Rails.configuration.action_mailer.send("#{Rails.configuration.action_mailer.delivery_method}_settings") # deivery settings
},
:from => "from@owenou.com", # from email
:to => "to@owenou.com", # to email
:subject => "subject", # email subject
:text_body => mail_text_body, # email body in text
:html_body => mail_html_body # email body in html
The travis middleware restarts the latest build with the provided repo.
builder.adapter :travis,
:access_token => "123", # travis-ci access token
:repo => "jingweno/multiple_notifier", # travis-ci repo in the format of OWNER/REPO
:travis_pro => true # whether this repo is built in travis-ci pro
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request