Sha256: 2760116206c5ad7d369ff5c939e0c96a2504c082a1ece1a929e805f7b5d7c1f4

Contents?: true

Size: 614 Bytes

Versions: 22

Compression:

Stored size: 614 Bytes

Contents

module Spree
  class PromotionCodeBatchJob < ActiveJob::Base
    queue_as :default

    def perform(promotion_code_batch)
      PromotionCode::BatchBuilder.new(
        promotion_code_batch
      ).build_promotion_codes

      if promotion_code_batch.email?
        Spree::PromotionCodeBatchMailer
          .promotion_code_batch_finished(promotion_code_batch)
          .deliver_now
      end
    rescue => e
      if promotion_code_batch.email?
        Spree::PromotionCodeBatchMailer
          .promotion_code_batch_errored(promotion_code_batch)
          .deliver_now
      end
      raise e
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
solidus_core-2.5.2 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.5.1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.5.0 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.5.0.rc1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.5.0.beta2 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.5.0.beta1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.4.2 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.4.1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.2.2 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.4.0 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.4.0.rc1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.4.0.beta1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.0 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.0.rc3 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.0.rc2 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.0.rc1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.3.0.beta1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.2.1 app/jobs/spree/promotion_code_batch_job.rb
solidus_core-2.2.0 app/jobs/spree/promotion_code_batch_job.rb