Sha256: b7dd1fb6d61e19f1d04026f4f8bac03dc68ac27ed074cfb5208e82b5247dc5f3

Contents?: true

Size: 494 Bytes

Versions: 24

Compression:

Stored size: 494 Bytes

Contents

module Spree
  module Core
    class MailMethod
      def initialize(options={})
      end

      def deliver!(mail)
        if Config.enable_mail_delivery
          mailer.deliver!(mail)
        end
      end

      def mailer
        mailer_class.new(mail_server_settings)
      end

      private
      def mailer_class
        Rails.env.test?? Mail::TestMailer : Mail::SMTP
      end

      def mail_server_settings
        MailSettings.new.mail_server_settings
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
spree_core-2.2.14 lib/spree/core/mail_method.rb
spree_core-2.2.13 lib/spree/core/mail_method.rb
spree_core-2.2.12 lib/spree/core/mail_method.rb
spree_core-2.2.11 lib/spree/core/mail_method.rb
spree_core-2.2.10 lib/spree/core/mail_method.rb
spree_core-2.2.9 lib/spree/core/mail_method.rb
spree_core-2.1.12 lib/spree/core/mail_method.rb
spree_core-2.2.8 lib/spree/core/mail_method.rb
spree_core-2.1.11 lib/spree/core/mail_method.rb
spree_core-2.2.7 lib/spree/core/mail_method.rb
spree_core-2.1.10 lib/spree/core/mail_method.rb
spree_core-2.1.9 lib/spree/core/mail_method.rb
spree_core-2.2.6 lib/spree/core/mail_method.rb
spree_core-2.2.5 lib/spree/core/mail_method.rb
spree_core-2.1.8 lib/spree/core/mail_method.rb
spree_core-2.2.4 lib/spree/core/mail_method.rb
spree_core-2.2.3 lib/spree/core/mail_method.rb
spree_core-2.2.2 lib/spree/core/mail_method.rb
spree_core-2.1.7 lib/spree/core/mail_method.rb
spree_core-2.1.6 lib/spree/core/mail_method.rb