1class EmailPetitionersJob < ApplicationJob
 
2  include EmailAllPetitionSignatories
 
3
 
4  self.email_delivery_job_class = DeliverPetitionEmailJob
 
5  self.timestamp_name = 'petition_email'
 
6
 
7  attr_reader :email
 
8
 
 9  # It's likely that the email got deleted so we just log the error and move on
 
10  rescue_from ActiveJob::DeserializationError do |exception|
 
11    log_exception(exception)
 
12  end
 
  • Complexity 1 » saikuro
14  def perform(**args)
 
15    @email = args[:email]
 
16    super
 
17  end
 
 
19  private
 
  • Complexity 1 » saikuro
21  def mailer_arguments(signature)
 
22    super.merge(email: email)
 
23  end
 
  • Complexity 1 » saikuro
25  def log_exception(exception)
 
26    logger.info(log_message(exception))
 
27  end
 
  • Complexity 1 » saikuro
29  def log_message(exception)
 
30    "#{exception.class.name} while running #{self.class.name}"
 
31  end
 
32end