Module: Isomorfeus

Defined in:
lib/isomorfeus/mailer/config.rb,
lib/isomorfeus/mailer/imports.rb,
lib/isomorfeus/mailer/version.rb

Defined Under Namespace

Modules: Mailer

Instance Method Summary collapse

Instance Method Details

#email_senderObject



14
15
16
17
18
19
20
# File 'lib/isomorfeus/mailer/config.rb', line 14

def email_sender
  @email_sender ||= MailHandler.sender(Isomorfeus.email_sender_config[:type]) do |dispatcher|
    Isomorfeus.email_sender_config.each do |key, value|
      dispatcher.__send__("#{key}=".to_sym, value) unless key == :type
    end
  end
end

#email_sender_configObject



5
6
7
# File 'lib/isomorfeus/mailer/config.rb', line 5

def email_sender_config
  @email_sender_config ||= { type: :smtp }
end

#email_sender_config=(new_config) ⇒ Object



9
10
11
12
# File 'lib/isomorfeus/mailer/config.rb', line 9

def email_sender_config=(new_config)
  Isomorfeus.raise_error(message: "email_sender_config must at least include a :type!") unless new_config.key?(:type)
  @email_sender_config = new_config
end