Module: SendGridMailer::InterceptorsHandler

Included in:
Deliverer, DevDeliverer
Defined in:
lib/send_grid_mailer/interceptors_handler.rb

Instance Method Summary collapse

Instance Method Details

#execute_interceptors(sg_definition) ⇒ Object



3
4
5
6
7
8
# File 'lib/send_grid_mailer/interceptors_handler.rb', line 3

def execute_interceptors(sg_definition)
  registered_interceptors.each do |interceptor|
    interceptor_class = "SendGridMailer::Interceptor::#{interceptor.class}".constantize
    interceptor_class.perform(sg_definition, interceptor)
  end
end

#registered_interceptorsObject



10
11
12
# File 'lib/send_grid_mailer/interceptors_handler.rb', line 10

def registered_interceptors
  ::Mail.class_variable_get(:@@delivery_interceptors)
end