Sha256: 983c2229349174f8898a1b84b06d9f9636e62fcd93e4d3b5a5ad04d19daf108d

Contents?: true

Size: 886 Bytes

Versions: 36

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

module EacRailsBase0
  class MailerController < ::EacRailsBase0::ApplicationController
    def info
      klass = ::ActionMailer::Base
      @sections = %w[default_params default_url_options smtp_settings].map do |section|
        ["#{klass}.#{section}", klass.send(section)]
      end.to_h
    end

    def send_test
      @record = ::EacRailsBase0::EmailSendTest.new
    end

    def send_test_submit
      @record = ::EacRailsBase0::EmailSendTest.new(send_test_submit_params)
      if @record.save
        flash[:success] = t('eac_rails_base0.mailer.send_test_successful', address: @record.address)
        redirect_to action: :send_test
      else
        render :send_test
      end
    end

    private

    def send_test_submit_params
      params[::EacRailsBase0::EmailSendTest.model_name.param_key].permit(:alternative_address)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
eac_rails_base0-0.68.1 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.68.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.67.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.66.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.65.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.64.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.63.1 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.63.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.62.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.61.1 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.61.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.60.4 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.60.3 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.60.2 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.60.1 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.60.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.59.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.58.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.57.0 app/controllers/eac_rails_base0/mailer_controller.rb
eac_rails_base0-0.56.0 app/controllers/eac_rails_base0/mailer_controller.rb