Sha256: 7d57d775b9f349487348f49bf2ce2590da5dea701ce85c2d3f04e7157fd44974

Contents?: true

Size: 874 Bytes

Versions: 29

Compression:

Stored size: 874 Bytes

Contents

module Spree
  module Emails
    module OrderDecorator
      def deliver_order_confirmation_email
        OrderMailer.confirm_email(id).deliver_later
        update_column(:confirmation_delivered, true)
      end

      # Returns true if:
      #   1. an email address is set for new order notifications AND
      #   2. no notification for this order has been sent yet.
      def deliver_store_owner_order_notification_email?
        store.new_order_notifications_email.present? && !store_owner_notification_delivered?
      end

      def deliver_store_owner_order_notification_email
        OrderMailer.store_owner_notification_email(id).deliver_later
        update_column(:store_owner_notification_delivered, true)
      end

      def send_cancel_email
        OrderMailer.cancel_email(id).deliver_later
      end

      ::Spree::Order.prepend(self)
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
spree_emails-4.8.3 app/models/spree/emails/order_decorator.rb
spree_emails-4.8.2 app/models/spree/emails/order_decorator.rb
spree_emails-4.7.3 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.6 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.5 app/models/spree/emails/order_decorator.rb
spree_emails-4.3.3 app/models/spree/emails/order_decorator.rb
spree_emails-4.4.1 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.4 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.5 app/models/spree/emails/order_decorator.rb
spree_emails-4.7.1 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.4 app/models/spree/emails/order_decorator.rb
spree_emails-4.7.0 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.3 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.2 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.1 app/models/spree/emails/order_decorator.rb
spree_emails-4.6.0 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.3 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.2 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.1 app/models/spree/emails/order_decorator.rb
spree_emails-4.5.0 app/models/spree/emails/order_decorator.rb