Sha256: 000e0405da1cc1a2a6953cdd5db909486731305d17597fac765fadb341d23263

Contents?: true

Size: 490 Bytes

Versions: 6

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    class ExportQuestionnaireAnswersJob < ApplicationJob
      queue_as :default

      def perform(user, title, answers)
        return if user&.email.blank?
        return if answers.blank?

        serializer = Decidim::Forms::UserAnswersSerializer
        export_data = Decidim::Exporters::FormPDF.new(answers, serializer).export

        ExportMailer.export(user, title, export_data).deliver_now
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-forms-0.24.3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.24.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.24.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.24.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.24.0.rc2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.24.0.rc1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb