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.26.8 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.4 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.3 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.7 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.5 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.4 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.3 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.0.rc2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.27.0.rc1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.0.rc2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.26.0.rc1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.25.2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.25.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.25.0 app/jobs/decidim/admin/newsletter_delivery_job.rb