Sha256: 6d54e0b5e56d2ae43590a9a3414711a23212e33978779ce8436ad6dd6c41da17

Contents?: true

Size: 1022 Bytes

Versions: 48

Compression:

Stored size: 1022 Bytes

Contents

class Caboose::SmtpConfig < ActiveRecord::Base
  self.table_name = "smtp_configs"
       
  belongs_to :site      
  attr_accessible :id, 
    :site_id              ,
    :address              ,
    :port                 ,
    :domain               ,
    :user_name            ,
    :password             ,
    :authentication       ,
    :enable_starttls_auto


  AUTH_PLAIN = 'plain'
  AUTH_LOGIN = 'login'
  AUTH_MD5 = 'cram_md5'
  
  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

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
caboose-cms-0.5.16 app/models/caboose/smtp_config.rb
caboose-cms-0.5.15 app/models/caboose/smtp_config.rb
caboose-cms-0.5.14 app/models/caboose/smtp_config.rb
caboose-cms-0.5.13 app/models/caboose/smtp_config.rb
caboose-cms-0.5.12 app/models/caboose/smtp_config.rb
caboose-cms-0.5.11 app/models/caboose/smtp_config.rb
caboose-cms-0.5.10 app/models/caboose/smtp_config.rb
caboose-cms-0.5.9 app/models/caboose/smtp_config.rb
caboose-cms-0.5.8 app/models/caboose/smtp_config.rb
caboose-cms-0.5.7 app/models/caboose/smtp_config.rb
caboose-cms-0.5.6 app/models/caboose/smtp_config.rb
caboose-cms-0.5.5 app/models/caboose/smtp_config.rb
caboose-cms-0.5.4 app/models/caboose/smtp_config.rb
caboose-cms-0.5.3 app/models/caboose/smtp_config.rb
caboose-cms-0.5.2 app/models/caboose/smtp_config.rb
caboose-cms-0.5.1 app/models/caboose/smtp_config.rb
caboose-cms-0.4.151 app/models/caboose/smtp_config.rb
caboose-cms-0.4.150 app/models/caboose/smtp_config.rb
caboose-cms-0.4.149 app/models/caboose/smtp_config.rb
caboose-cms-0.4.148 app/models/caboose/smtp_config.rb