What I need:
Something similar to before_filter in ActionMailer in Rails 3.
Problem:
I am working on Rails 3 and want to have a before_filter in ActionMailer. Checked the actionmailer api and learned about before_action and after_action callbacks. When implemented it gives the error:
NoMethodError: undefined method `before_action' for Notifier:Class
Later learned that there is no before action call for Rails 3 from this post
Isnt there any hook or gem so that we can have something similar like before_filter in Rails 3.
Please help. Many Thanks!!
It can be achieved by including AbstractController::Callbacks. This mimics the change to Rails 4 which apart from comments and tests, just included Callbacks.
Reference - How to add a before_filter in UserMailer which checks if it is OK to mail a user?