Sha256: 37c91ffe9dfef1363c488aeea55d3aacae46414f2307b6c2f56098aa6a356c4d

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

module Co
  class OrderMessageMailer < 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> • Телефон: #{message.phone}"
      result += "<br> • Адрес: #{message.city}"
      result += "<br> • Детали заказа:<br><br> #{message.comment}"
      result
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
c80_yax-0.1.0.25 engines/co/app/mailers/co/order_message_mailer.rb
c80_yax-0.1.0.24 engines/co/app/mailers/co/order_message_mailer.rb
c80_yax-0.1.0.23 engines/co/app/mailers/co/order_message_mailer.rb
c80_yax-0.1.0.22 engines/co/app/mailers/co/order_message_mailer.rb
c80_yax-0.1.0.21 engines/co/app/mailers/co/order_message_mailer.rb
c80_yax-0.1.0.20 engines/co/app/mailers/co/order_message_mailer.rb