demarches-normaliennes/app/jobs/warn_expiring_dossiers_job.rb
2020-03-18 15:25:02 +01:00

11 lines
295 B
Ruby

class WarnExpiringDossiersJob < ApplicationJob
queue_as :cron
def perform(*args)
expiring, expired = Dossier
.en_instruction_close_to_expiration
.partition(&:retention_expired?)
AdministrationMailer.dossier_expiration_summary(expiring, expired).deliver_later
end
end