Sha256: 1a280556d051b78e48e1b776641c3029dbf6be61824b9bb58cf93026fddaa578

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

module C80Callback
  class CallbacksMailer < ActionMailer::Base

    default from: Proc.new { SiteProp.first.mail_from },
            to: Proc.new { SiteProp.first.mail_to }

    def send_email(message, subject)
      @message = format_message(message)

      puts '<CallbackMailer.send_mess> Отправляем сообщение.'
      mail(subject: subject) do |format|
        format.html { render 'mail_letter' }
      end

      #puts "#{SiteProps.first.mail_to}"
    end

    private

    def format_message(message)
      result = "<br> • Имя: #{message.name}"
      result += "<br> • Email: #{message.mobile}"
      result
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_callback-0.1.0.2 app/mailers/c80_callback/callbacks_mailer.rb