Class: Caboose::SmtpConfig

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose/smtp_config.rb

Constant Summary collapse

AUTH_PLAIN =
'plain'
AUTH_LOGIN =
'login'
AUTH_MD5 =
'cram_md5'

Class Method Summary collapse

Class Method Details

.configure_mailer_for_site(mailer, site_id) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/models/caboose/smtp_config.rb', line 20

def self.configure_mailer_for_site(mailer, site_id)
  c = self.where(:site_id => site_id).first
  
  mailer.smtp_settings['user_name']            = c.user_name
  mailer.smtp_settings['password']             = c.password
  mailer.smtp_settings['address']              = c.address
  mailer.smtp_settings['port']                 = c.port
  mailer.smtp_settings['domain']               = c.domain
  mailer.smtp_settings['authentication']       = c.authentication
  mailer.smtp_settings['enable_starttls_auto'] = c.enable_starttls_auto
  
  return mailer
end