Class: Mailtrap::ActionMailer::DeliveryMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/mailtrap/action_mailer/delivery_method.rb

Constant Summary collapse

ALLOWED_PARAMS =
%i[api_key api_host api_port bulk sandbox inbox_id].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ DeliveryMethod

Returns a new instance of DeliveryMethod.



10
11
12
# File 'lib/mailtrap/action_mailer/delivery_method.rb', line 10

def initialize(settings)
  self.settings = settings
end

Instance Attribute Details

#settingsObject

Returns the value of attribute settings.



6
7
8
# File 'lib/mailtrap/action_mailer/delivery_method.rb', line 6

def settings
  @settings
end

Instance Method Details

#deliver!(message) ⇒ Object



14
15
16
17
18
# File 'lib/mailtrap/action_mailer/delivery_method.rb', line 14

def deliver!(message)
  mail = Mailtrap::Mail.from_message(message)

  client.send(mail)
end