File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ def perform(promotion_code_batch)
1010 ) . build_promotion_codes
1111
1212 if promotion_code_batch . email?
13- Spree ::PromotionCodeBatchMailer
13+ Spree ::Config . promotion_code_batch_mailer_class
1414 . promotion_code_batch_finished ( promotion_code_batch )
1515 . deliver_now
1616 end
1717 rescue StandardError => e
1818 if promotion_code_batch . email?
19- Spree ::PromotionCodeBatchMailer
19+ Spree ::Config . promotion_code_batch_mailer_class
2020 . promotion_code_batch_errored ( promotion_code_batch )
2121 . deliver_now
2222 end
Original file line number Diff line number Diff line change @@ -307,6 +307,15 @@ def default_pricing_options
307307 # @api experimental
308308 class_name_attribute :shipping_rate_tax_calculator_class , default : 'Spree::TaxCalculator::ShippingRate'
309309
310+ # Allows providing your own Mailer for promotion code batch mailer.
311+ #
312+ # @!attribute [rw] promotion_code_batch_mailer_class
313+ # @return [ActionMailer::Base] an object that responds to "promotion_code_batch_finished",
314+ # and "promotion_code_batch_errored"
315+ # (e.g. an ActionMailer with a "promotion_code_batch_finished" method) with the same
316+ # signature as Spree::PromotionCodeBatchMailer.promotion_code_batch_finished.
317+ class_name_attribute :promotion_code_batch_mailer_class , default : 'Spree::PromotionCodeBatchMailer'
318+
310319 # Allows providing your own Mailer for shipped cartons.
311320 #
312321 # @!attribute [rw] carton_shipped_email_class
You can’t perform that action at this time.
0 commit comments