demarches-normaliennes/app/jobs/warn_expiring_dossiers_job.rb

12 lines
328 B
Ruby
Raw Normal View History

2020-03-28 16:49:40 +01:00
class WarnExpiringDossiersJob < CronJob
self.schedule_expression = "every 1 month at midnight"
def perform(*args)
expiring, expired = Dossier
.en_instruction_close_to_expiration
.partition(&:retention_expired?)
AdministrationMailer.dossier_expiration_summary(expiring, expired).deliver_later
end
end