Sha256: c09dd4e3abc7fd8b73cf47879072cd025bbed7271d3f4b3ade627da8e5d08359

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

module Spree
  Order.class_eval do

    def deliver_order_confirmation_email
      #OrderMailer.confirm_email(id).deliver_later  # we replace OrderMailer with DelayedSend

      external_key = Spree::BrontoConfiguration.account[store.code]["order_received"]
      DelayedSend.new( store.code,
                       email,
                       external_key,
                       id.to_s,
                       "order_mailer/order_confirm_plain",
                       "order_mailer/order_confirm_html").perform

      update_column(:confirmation_delivered, true)
    end

    private
    def send_cancel_email
      #OrderMailer.cancel_email(id).deliver_later

      external_key = Spree::BrontoConfiguration.account[store.code]['order_canceled']
      DelayedSend.new( store.code,
                       email,
                       external_key,
                       id.to_s,
                       "order_mailer/order_cancel_plain",
                       "order_mailer/order_cancel_html").perform
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_bronto-3.0.0 app/models/spree/order_decorator.rb