1module Archived |
|
2 class EmailPetitionersJob < ApplicationJob |
|
3 include EmailAllPetitionSignatories |
|
5 self.email_delivery_job_class = Archived::DeliverPetitionEmailJob |
|
6 self.timestamp_name = 'petition_email' |
|
8 attr_reader :email |
|
10 # It's likely that the email got deleted so we just log the error and move on |
|
11 rescue_from ActiveJob::DeserializationError do |exception| |
|
12 log_exception(exception)
|
|
13 end |
|
|
15 def perform(**args) |
16 @email = args[:email] |
|
17 super |
|
18 end |
|
20 private
|
|
|
22 def mailer_arguments(signature) |
23 super.merge(email: email) |
|
24 end |
|
|
26 def log_exception(exception) |
27 logger.info(log_message(exception))
|
|
28 end |
|
|
30 def log_message(exception) |
31 "#{exception.class.name} while running #{self.class.name}" |
|
32 end |
|
33 end |
|
34end |