Sha256: 27467ee380b6f1782a0669a4f5ea63d977551e71b24a03b380b25744adf31c82

Contents?: true

Size: 449 Bytes

Versions: 9

Compression:

Stored size: 449 Bytes

Contents

module SendGridMailer
  class Deliverer
    include InterceptorsHandler
    include Logger

    def deliver!(sg_definition)
      execute_interceptors(sg_definition)
      log_definition(sg_definition)
      sg_api.send_mail(sg_definition)
    end

    private

    def sg_api
      @sg_api ||= Api.new(api_key)
    end

    def api_key
      Rails.application.config.action_mailer.sendgrid_settings[:api_key]
    rescue
      nil
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
send_grid_mailer-2.4.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-2.3.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-2.2.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-2.0.1 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-2.0.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-1.2.1 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-1.2.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-1.1.0 lib/send_grid_mailer/deliverer.rb
send_grid_mailer-1.0.0 lib/send_grid_mailer/deliverer.rb