Sha256: 1fdd15b1663cd0e2f77efa4c6c30035a30412705dcdf565d51a693e09d5edad9

Contents?: true

Size: 808 Bytes

Versions: 7

Compression:

Stored size: 808 Bytes

Contents

module Spree
  module Admin
    class MailMethodsController < ResourceController
      after_filter :initialize_mail_settings

      def testmail
        @mail_method = Spree::MailMethod.find(params[:id])
        if TestMailer.test_email(@mail_method, respond_to?(:current_user) ? current_user : nil).deliver
          flash.notice = t('admin.mail_methods.testmail.delivery_success')
        else
          flash[:error] = t('admin.mail_methods.testmail.delivery_error')
        end
      rescue Exception => e
        flash[:error] = t('admin.mail_methods.testmail.error') % {:e => e}
      ensure
        respond_with(@mail_method) { |format| format.html { redirect_to :back } }
      end

      private
      def initialize_mail_settings
        Spree::Core::MailSettings.init
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_core-1.1.3 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.2 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.2.rc1 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.1 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.0 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.0.rc2 app/controllers/spree/admin/mail_methods_controller.rb
spree_core-1.1.0.rc1 app/controllers/spree/admin/mail_methods_controller.rb