Sha256: c68fda81c797b8b8baa6fd5640beb1187ddf0c4bbdcee8b91fa16371faa2074c

Contents?: true

Size: 1.35 KB

Versions: 25

Compression:

Stored size: 1.35 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

25 entries across 25 versions & 2 rubygems

Version Path
spree_core-1.1.2 app/models/spree/mail_method.rb
spree_core-1.1.2.rc1 app/models/spree/mail_method.rb
spree_core-1.1.1 app/models/spree/mail_method.rb
spree_core-1.1.0 app/models/spree/mail_method.rb
spree_core-1.1.0.rc2 app/models/spree/mail_method.rb