Class: EmailEvents::Adapters::Sendgrid::Initializer

Inherits:
Abstract::Initializer show all
Defined in:
lib/email_events/adapters/sendgrid/initializer.rb

Class Method Summary collapse

Class Method Details

.initializeObject



11
12
13
14
15
16
17
# File 'lib/email_events/adapters/sendgrid/initializer.rb', line 11

def self.initialize
  Gridhook.configure do |config|
    config.event_receive_path = '/email_events/sendgrid'

    config.event_processor = EmailEvents::Service::HandleEvent
  end
end

.load_adapter?Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/email_events/adapters/sendgrid/initializer.rb', line 6

def self.load_adapter?
  smtp_settings = Rails.configuration.action_mailer.smtp_settings
  smtp_settings.present? && smtp_settings[:address].include?('sendgrid')
end