Sha256: 13785e13d11bf3ede388ec3539f27349b987db465859c420e2160c48f995c076

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

module Spree
  class MailMethod < ActiveRecord::Base

    MAIL_AUTH = ['none', 'plain', 'login', 'cram_md5']
    SECURE_CONNECTION_TYPES = ['None','SSL','TLS']

    preference :enable_mail_delivery, :boolean, :default => false
    preference :mail_host, :string, :default => 'localhost'
    preference :mail_domain, :string, :default => 'localhost'
    preference :mail_port, :integer, :default => 25
    preference :mail_auth_type, :string, :default => MAIL_AUTH[0]
    preference :smtp_username, :string
    preference :smtp_password, :string
    preference :secure_connection_type, :string, :default => SECURE_CONNECTION_TYPES[0]
    preference :mails_from, :string, :default => 'no-reply@example.com'
    preference :mail_bcc, :string, :default => 'spree@example.com'
    preference :intercept_email, :string, :default => nil

    attr_accessible :environment, :preferred_enable_mail_delivery,
                :preferred_mails_from, :preferred_mail_bcc,
                :preferred_intercept_email, :preferred_mail_domain,
                :preferred_mail_host, :preferred_mail_port,
                :preferred_secure_connection_type, :preferred_mail_auth_type,
                :preferred_smtp_username, :preferred_smtp_password

    validates :environment, :presence => true

    def self.current
      where(:environment => Rails.env).first
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/models/spree/mail_method.rb
spree_core-1.0.6 app/models/spree/mail_method.rb