Sha256: 5971d2a90ecaba83fb1bb2ba171fd34a5c7c7754a33a49fd4cb70132ab036bc7

Contents?: true

Size: 425 Bytes

Versions: 40

Compression:

Stored size: 425 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

        newsletter.with_lock do
          newsletter.increment!(:total_deliveries)
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
decidim-admin-0.6.8 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.8 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.7 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.7 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.6 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.6 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.5 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.5 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.4 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.4 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.3 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.3 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.2 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.2 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.1 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.6.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.6.0 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.5.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.5.1 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb