Sha256: 54d1f8fa185a6d51f0e089081ac56d15074ea2bab32863327878c4c8669957dd

Contents?: true

Size: 491 Bytes

Versions: 8

Compression:

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

8 entries across 8 versions & 1 rubygems

Version Path
decidim-forms-0.23.6 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.5 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.4 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.3 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.2 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.1.rc1 app/jobs/decidim/forms/export_questionnaire_answers_job.rb
decidim-forms-0.23.0 app/jobs/decidim/forms/export_questionnaire_answers_job.rb