Sha256: a42a4889f4286ab390c96e13400722ed18a3fa653238d77bd5b04efb2285d35d

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

module C80OrderForm
  class MessageOrderMailer < ActionMailer::Base

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

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

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

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

    private

    def format_message(message)
      result = "<br> • Имя: #{message.name}"
      result += "<br> • Email или телефон: #{message.email_or_phone}"
      result += "<br> • Сообщение: #{message.comment}"
      result
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
c80_order_form-0.1.0.1 app/mailers/c80_order_form/message_order_mailer.rb