Module: Bizside::Configurations::Mail

Included in:
Bizside::Config
Defined in:
lib/bizside/configurations/mail.rb

Instance Method Summary collapse

Instance Method Details

#default_url_optionsObject



19
20
21
# File 'lib/bizside/configurations/mail.rb', line 19

def default_url_options
  {:protocol => 'https', :host => mail.app_host, :script_name => prefix}
end

#mailObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bizside/configurations/mail.rb', line 5

def mail
  if @mail.nil?
    configfile = File.join('config', 'mail.yml')
  
    if File.exist?(configfile)
      @mail = Bizside::Config.new(YAML.load_file(configfile)[Bizside.env])
    else
      @mail = Bizside::Config.new
    end
  end

  @mail
end

#smtp_settingsObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bizside/configurations/mail.rb', line 23

def smtp_settings
  ret = {}
  ret[:address] = mail.smtp.host if mail.smtp.host?
  ret[:port] = mail.smtp.port if mail.smtp.port?
  ret[:enable_starttls_auto] = mail.smtp.enable_starttls_auto if mail.smtp.enable_starttls_auto?
  ret[:openssl_verify_mode] = mail.smtp.openssl_verify_mode if mail.smtp.openssl_verify_mode?
  ret[:authentication] = mail.smtp.authentication if mail.smtp.authentication?
  ret[:user_name] = mail.smtp.username if mail.smtp.username?
  ret[:password] = mail.smtp.password if mail.smtp.password?
  ret
end