Class: Hubspot::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/hubspot/mailer.rb

Instance Method Summary collapse

Instance Method Details

#mail(headers = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/hubspot/mailer.rb', line 3

def mail(headers = {}, &block)
  configuration = Hubspot.configuration

  smtp_user = configuration.user_name
  smtp_password = configuration.password
  smtp_host = configuration.address
  smtp_port = configuration.port

  delivery_method_options = { user_name: smtp_user, password: smtp_password, address: smtp_host, port: smtp_port, authentication: :plain, enable_starttls_auto: true }

  headers = headers.merge!(delivery_method_options: delivery_method_options)

  super
end