Sha256: 56fd84c6d15bfafa7726b87d6c41590fa418ae0b9861bc754c434c4b64688ac8

Contents?: true

Size: 972 Bytes

Versions: 24

Compression:

Stored size: 972 Bytes

Contents

module Spree
  module Admin
    class MailMethodsController < Spree::Admin::BaseController
      def update
        if params[:smtp_password].blank?
          params.delete(:smtp_password)
        end

        params.each do |name, value|
          next unless Spree::Config.has_preference? name
          Spree::Config[name] = value
        end

        flash[:success] = Spree.t(:successfully_updated, :resource => Spree.t(:mail_methods))
        redirect_to edit_admin_mail_method_url
      end

      def testmail
        if TestMailer.test_email(try_spree_current_user.id).deliver
          flash[:success] = Spree.t('admin.mail_methods.testmail.delivery_success')
        else
          flash[:error] = Spree.t('admin.mail_methods.testmail.delivery_error')
        end
      rescue Exception => e
        flash[:error] = Spree.t('admin.mail_methods.testmail.error') % {:e => e}
      ensure
        redirect_to edit_admin_mail_method_url
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
spree_backend-2.2.14 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.13 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.12 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.11 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.10 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.9 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.12 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.8 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.11 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.7 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.10 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.9 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.6 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.5 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.8 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.4 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.3 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.2 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.1.7 app/controllers/spree/admin/mail_methods_controller.rb
spree_backend-2.2.1 app/controllers/spree/admin/mail_methods_controller.rb