initial commit
[acts_as_subscribeable.git] / README
blob613de627fca2e41c4d60168f6fd22961b384eb38
1 ActsAsSubscribeable
2 ===================
4 The acts_as_subscribeable plugin is a generator and plugin to allow the subscription based email notification 
5 (or other system if you choose to implement it differently) of changes in the model you specify as a subscribeable
6 object. The associations are polymorphic and can pertain to any model type.
8 Prerequisites
9 =============
10 Rails 1.2.6+
11 A User model that includes a field called email (Restful Auth compatible!)
13 Installing the plugin
14 =====================
15   -- Get the plugin:
16     ./script/plugin install http://repo.or.cz/r/acts_as_subscribeable.git
17   -- Run:
18     ./script/generate acts_as_subscribeable_installation
19   -- Add a has_many :subscriptions to your User model
20   -- Configure the mailer initializer placed in /config/initializers/mailer.rb for your mail server
22   NOTES:
23   ======
24   This will install the migration file and mailer initializer for the plugin.
26 Generating Subscribebale Models
27 ===============================
28   -- Create a model
29   -- Add the hook:
30     acts_as_subscribeable
31   
32   -- Run:
33     ./script/generate subscribeable_model MODEL_NAME
35   -- Add your observer hook in your environment.rb file
36     config.active_record.observers = :MODEL_NAME_observer  
38   NOTES:
39   ======
40   This will generate an observer and mailer for your model and hook in the observer. It defaults to an after_update 
41   callback but you can add as many as you need or customize the observer to watch a parent model to alert on child 
42   creation instead.
44 Customizing your email notification
45 ===============================
46   -- Customize the generated send_email_notification.html.erb file in your MODEL_NAME_mailer views directory to suit your needs  and the MODEL_NAME_mailer.rb mailer in your Models directory.
48 Copyright (c) 2007 E. James O'Kelly, released under the MIT license
49 www.railsjitsu.com