module ActionMailer::Previews::ClassMethods
def register_preview_interceptor(interceptor)
Either a class or a string can be passed in as the Interceptor. If a
Register an Interceptor which will be called before mail is previewed.
def register_preview_interceptor(interceptor) preview_interceptor = case interceptor when String, Symbol interceptor.to_s.camelize.constantize else interceptor end unless preview_interceptors.include?(preview_interceptor) preview_interceptors << preview_interceptor end end
def register_preview_interceptors(*interceptors)
def register_preview_interceptors(*interceptors) interceptors.flatten.compact.each { |interceptor| register_preview_interceptor(interceptor) } end