Class: EacRailsBase0::MailerController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eac_rails_base0/mailer_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

active_scaffold_controller_for, #after_sign_in_path_for

Instance Method Details

#infoObject



5
6
7
8
9
10
# File 'app/controllers/eac_rails_base0/mailer_controller.rb', line 5

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

#send_testObject



12
13
14
# File 'app/controllers/eac_rails_base0/mailer_controller.rb', line 12

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

#send_test_submitObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/eac_rails_base0/mailer_controller.rb', line 16

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