Class: Decidim::Initiatives::ExportInitiativesJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/initiatives/export_initiatives_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(user, organization, format, collection_ids = nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'app/jobs/decidim/initiatives/export_initiatives_job.rb', line 8

def perform(user, organization, format, collection_ids = nil)
  export_data = Decidim::Exporters.find_exporter(format).new(
    collection_to_export(collection_ids, organization),
    serializer
  ).export

  ExportMailer.export(user, "initiatives", export_data).deliver_now
end