Sha256: 554fded05297396c7396f3eb2c7e4d27e553c7c0380c17d76ac4ca7f36f9c1d5

Contents?: true

Size: 424 Bytes

Versions: 10

Compression:

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

10 entries across 10 versions & 2 rubygems

Version Path
decidim-admin-0.1.0 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.1.0 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.0.8.1 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.0.8.1 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.0.7 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.0.7 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.0.6 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.0.6 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-admin-0.0.5 app/jobs/decidim/admin/newsletter_delivery_job.rb
decidim-0.0.5 decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb