Rails Application Notification Plugins
Can anyone recommend some rails plugins that will allow me to log various pattern notice that might be related to a set of email formatting templates (and possibly others).
Ideally the plugin could be referenced in one line from each model, and the notification format could be passed from some construct like user preference etc.
Appreciate your help
Dom
+2
source to share
2 answers
observational is a good way to ... observe :)
class Notifier < ActionMailer::Base
observes :user, :after => :create, :invokes => :deliver_welcome_email
def welcome_email(user)
end
end
+3
source to share
I'm not sure why you need a plugin to do this as it can be done using ActiveRecord callbacks , set up a callback in each model like
after_save :send_notifications
def send_notifications
Notifier.deliver_signup_notification(template, user) # sends the email
end
You will need to collapse your own interface to create and select HTML templates if this is not what your application logic dictates.
+2
source to share