Sha256: fb2621123c424bf62ce959976b6ffc16519a42f52b80c87adbdbd15013a33ac8

Contents?: true

Size: 532 Bytes

Versions: 104

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Custom ApplicationJob scoped to the admin panel.
    #
    class NewsletterDeliveryJob < ApplicationJob
      queue_as :newsletter

      def perform(user, newsletter)
        NewsletterMailer.newsletter(user, newsletter).deliver_now

        # rubocop:disable Rails/SkipsModelValidations
        newsletter.with_lock do
          newsletter.increment!(:total_deliveries)
        end
        # rubocop:enable Rails/SkipsModelValidations
      end
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.4 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.9 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.29.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.3 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.8 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.29.0.rc4 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.29.0.rc3 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.29.0.rc2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.29.0.rc1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.7 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.6 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.10 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.9 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.5 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.0.rc5 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.28.0.rc4 app/jobs/decidim/admin/newsletter_delivery_job.rb