I have two mailers:
class Mailer1 < ActionMailer::Base
def mail
if check_something?
end
end
private
def check_something?
end
end
class Mailer2 < ActionMailer::Base
def another_mail
if check_something?
end
end
private
def check_something?
end
end
(I understand I can pull in view helpers for the actual mail templates, but how can I make it work for controller-type “helper” methods – as ActionMailers derive from Abstract Controller these days.)
So, where can I declare check_something?, and how can I make it accessible to both my mailers?
Just create a base class, like you get by default with ApplicationController for your http controllers: