Sha256: 9806c47248d255e2e6de34a71d452d4fa0b27ea4c74833ef6229f44d75144cf2

Contents?: true

Size: 490 Bytes

Versions: 44

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    class ExportQuestionnaireAnswersJob < ApplicationJob
      queue_as :exports

      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

44 entries across 44 versions & 1 rubygems

Version Path
decidim-forms-0.26.8 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.7 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.5 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.0.rc2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.0.rc1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.0.rc2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.0.rc1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.25.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.25.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.25.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb