1class EmailPetitionersJob < ApplicationJob |
|
2 include EmailAllPetitionSignatories |
|
4 self.email_delivery_job_class = DeliverPetitionEmailJob |
|
5 self.timestamp_name = 'petition_email' |
|
7 attr_reader :email |
|
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 |
|
|
14 def perform(**args) |
15 @email = args[:email] |
|
16 super |
|
17 end |
|
19 private
|
|
|
21 def mailer_arguments(signature) |
22 super.merge(email: email) |
|
23 end |
|
|
25 def log_exception(exception) |
26 logger.info(log_message(exception))
|
|
27 end |
|
|
29 def log_message(exception) |
30 "#{exception.class.name} while running #{self.class.name}" |
|
31 end |
|
32end |