Sha256: 1a046b357e9d9164849b706420a84dc51bf76eab31e7a0cc3fc38650d80005cd
Contents?: true
Size: 848 Bytes
Versions: 23
Compression:
Stored size: 848 Bytes
Contents
# frozen_string_literal: true require 'spree/event/subscriber' module Spree # Legacy subscriber # # This subscriber module is used by the legacy pub/sub system (see # {Spree::Event}). module MailerSubscriber include Spree::Event::Subscriber event_action :order_finalized event_action :send_reimbursement_email, event_name: :reimbursement_reimbursed def order_finalized(event) order = event.payload[:order] unless order.confirmation_delivered? Spree::Config.order_mailer_class.confirm_email(order).deliver_later order.update_column(:confirmation_delivered, true) end end def send_reimbursement_email(event) reimbursement = event.payload[:reimbursement] Spree::Config.reimbursement_mailer_class.reimbursement_email(reimbursement.id).deliver_later end end end
Version data entries
23 entries across 23 versions & 1 rubygems