Sha256: c9690788448d03dbaef3a4a4d38b3595e72349a708de944bc122868eb89015a0

Contents?: true

Size: 623 Bytes

Versions: 17

Compression:

Stored size: 623 Bytes

Contents

class OrderMailer < ActionMailer::Base
  layout "mail"

  def confirmation_for(order)
    @order = order
    @person = order.person
    options = Hash.new.tap do |o|
      o[:to] = @person.email
      o[:from] = from(@order)
      o[:subject] = "Your Order"
      if order.contact_email.present?
        o[:reply_to] = order.contact_email
      end
    end
    
    mail(options)
  end

private

  def from(order)
    if ARTFULLY_CONFIG[:contact_email].present?
      ARTFULLY_CONFIG[:contact_email]
    elsif order.contact_email.present?
      order.contact_email
    else
      order.organization.email
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.15 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.12 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.11 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.10 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.9 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.8 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.7 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.6 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.5 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.4 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.3 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.2 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre.1 app/mailers/order_mailer.rb
artfully_ose-1.2.0.pre app/mailers/order_mailer.rb
artfully_ose-1.1.0 app/mailers/order_mailer.rb
artfully_ose-1.1.0.rc2 app/mailers/order_mailer.rb
artfully_ose-1.1.0.rc1 app/mailers/order_mailer.rb