Acts As Notifiable plugin

Plugin details

ActsAsNotifiable enables your Rails app to send notification to Jabber client.

Repositoryhttp://svn.s21g.com/public/rails/plugins/acts_as_notifiable/ Author Satoko Hibi Tags email LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.s21g.com/public/rails/plugins/acts_as_notifiable/

Requirements
=======
XMPP4R (http://xmpp4r.rubyforge.org/)

$sudo gem install xmpp4r



Example
=======
== Add config file to your Rails app.
#{RAILS_ROOT}/config/acts_as_notifiable.yml
to:

  recipients: you@gmail.com me@gmail.com


from:

  id: your_notify_account@gmail.com
  password: pass
  connect: talk.google.com



== Add +acts_as_notifiable+ to the Model class:

class Post < ActiveRecord::Base
  acts_as_notifiable :callback => :after_create,
    :message => Proc.new {|o| "[#{o.class.name}]##{o.id} #{o.body}"},
    :recipients => "aaa@gmail.com bbb@gmail.com"
end



class AnotherPost < ActiveRecord::Base
  acts_as_notifiable :message => :title, :recipients => Proc.new {|o| o.members.dup << "admin@gmail.com" }
end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, about 1 month ago