module Mail
def self.register_interceptor(interceptor)
which receives the email that is about to be sent. Make your modifications
Your object needs to respond to a single method #delivering_email(mail)
email that gets sent through the Mail library, you can do so.
before it is sent. So if you want to add special headers or modify any
You can register an object to be given every mail object that will be sent,
def self.register_interceptor(interceptor) unless @@delivery_interceptors.include?(interceptor) @@delivery_interceptors << interceptor end end