Hello, I currently have my app’s mail setup as follows:
Step 1:
Observers monitor tables, and send out emails when triggered by
after_save in the observer
Step 2:
The observer then calls something like:
UserMailer.XXXXXX_created_notification(record).deliver
Step 3:
User mailer sends the mail out:
def XXXXXX_created_notification(record)
@record = record
mail(:to => "#{record.email}", :reply_to => "Reply to
XXXXX", :subject => “XXXXX Notification”)
end
My question to rails experts out there is, I want to provide users the
ability to turn on/off certain site wide notifications. Where is the
best place in Rails to bake this in? In the user_mailer.rb file
wrapped inside the def above? Or in the observer?
Suggestions?
Thanks