Sha256: 8c97510815fee0e5a32569188731e6dfb8923fbecd31adcd2ac0c1da8ec0e4b2

Contents?: true

Size: 1.09 KB

Versions: 44

Compression:

Stored size: 1.09 KB

Contents

module Bizside
  module Configurations
    module Mail

      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

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

      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

    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
bizside-3.0.7 lib/bizside/configurations/mail.rb
bizside-3.0.6 lib/bizside/configurations/mail.rb
bizside-3.0.5 lib/bizside/configurations/mail.rb
bizside-3.0.4 lib/bizside/configurations/mail.rb
bizside-2.3.9 lib/bizside/configurations/mail.rb
bizside-3.0.3 lib/bizside/configurations/mail.rb
bizside-2.3.8 lib/bizside/configurations/mail.rb
bizside-3.0.2 lib/bizside/configurations/mail.rb
bizside-3.0.1 lib/bizside/configurations/mail.rb
bizside-3.0.0 lib/bizside/configurations/mail.rb
bizside-2.3.7 lib/bizside/configurations/mail.rb
bizside-2.3.6 lib/bizside/configurations/mail.rb
bizside-2.3.5 lib/bizside/configurations/mail.rb
bizside-2.3.4 lib/bizside/configurations/mail.rb
bizside-2.3.3 lib/bizside/configurations/mail.rb
bizside-2.3.2 lib/bizside/configurations/mail.rb
bizside-2.3.1 lib/bizside/configurations/mail.rb
bizside-2.3.0 lib/bizside/configurations/mail.rb
bizside-2.2.3 lib/bizside/configurations/mail.rb
bizside-2.2.2 lib/bizside/configurations/mail.rb