Class: MnoEnterprise::MailClient

Inherits:
Object
  • Object
show all
Defined in:
lib/mno_enterprise/mail_client.rb

Overview

Abstract the email sending logic

Class Method Summary collapse

Class Method Details

.adapter=(name_or_adapter) ⇒ Object

Specify the mail adapter. The default email adapter is the :mandrill adapter.



8
9
10
11
12
13
14
15
16
# File 'lib/mno_enterprise/mail_client.rb', line 8

def self.adapter=(name_or_adapter)
  @@adapter = \
    case name_or_adapter
    when Symbol, String
      load_adapter(name_or_adapter)
    else
      name_or_adapter if name_or_adapter.respond_to?(:deliver)
    end
end

.deliver(*args) ⇒ Object

See Also:

  • Adapter#deliver


19
20
21
# File 'lib/mno_enterprise/mail_client.rb', line 19

def self.deliver(*args)
  adapter.deliver(*args)
end