2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-08-14 12:46:56 +02:00
|
|
|
class Cron::PurgeOldSibMailsJob < Cron::CronJob
|
2024-06-13 16:40:08 +02:00
|
|
|
self.schedule_expression = "every day at 00:15"
|
2021-08-14 12:46:56 +02:00
|
|
|
|
|
|
|
def perform
|
|
|
|
sib = Sendinblue::API.new
|
|
|
|
day_to_delete = (Time.zone.today - 31.days).strftime("%Y-%m-%d")
|
|
|
|
sib.delete_events(day_to_delete)
|
|
|
|
end
|
|
|
|
end
|