Class: Decidim::DirectVerifications::BaseImportJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/direct_verifications/base_import_job.rb

Overview

This class implements the logic to import the user entries and sending an email notification with the result. The specifics to process the entries are meant to be implemented by subclasses which must implement the ‘#process_users` and `#type` methods.

Instance Method Summary collapse

Instance Method Details

#perform(userslist, organization, current_user, authorization_handler) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'app/jobs/decidim/direct_verifications/base_import_job.rb', line 13

def perform(userslist, organization, current_user, authorization_handler)
  @emails = Parsers::MetadataParser.new(userslist).to_h
  @organization = organization
  @current_user = current_user
  @instrumenter = Instrumenter.new(current_user)
  @authorization_handler = authorization_handler

  process_users
  send_email_notification
end