Class: Cloudflare::EmailService::Rails::DeliveryMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudflare/email_service/rails.rb

Overview

ActionMailer delivery method. Credentials and transport come from Cloudflare::EmailService.configure; this just maps the message and hands it to the configured transport client. Inject ‘client:` in settings to override (used in tests).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ DeliveryMethod

Returns a new instance of DeliveryMethod.



106
107
108
# File 'lib/cloudflare/email_service/rails.rb', line 106

def initialize(settings = {})
  @settings = settings || {}
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



104
105
106
# File 'lib/cloudflare/email_service/rails.rb', line 104

def settings
  @settings
end

Instance Method Details

#deliver!(mail) ⇒ Response

Parameters:

  • mail (Mail::Message)

    the message ActionMailer built.

Returns:



112
113
114
# File 'lib/cloudflare/email_service/rails.rb', line 112

def deliver!(mail)
  client.deliver(Message.new(**MessageMapping.call(mail)))
end