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.29.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.9 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.29.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.8 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.29.0.rc4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.29.0.rc3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.29.0.rc2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.29.0.rc1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.7 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.6 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.10 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.26.9 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.27.5 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.0.rc5 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.28.0.rc4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb