Sha256: 1269b1e5da89d42e04e436311f8c9a4e87ffaad28c7018fb40b0dd416fd5def4
Contents?: true
Size: 730 Bytes
Versions: 12
Compression:
Stored size: 730 Bytes
Contents
# frozen_string_literal: true namespace :decidim do namespace :mailers do desc "Task to send the notification digest email with the daily report" task notifications_digest_daily: :environment do notifications_digest(:daily) end desc "Task to send the notification digest email with the weekly report" task notifications_digest_weekly: :environment do notifications_digest(:weekly) end end def notifications_digest(frequency) target_users = Decidim::User.where(notifications_sending_frequency: frequency) time = Time.now.utc target_users.find_each do |user| Decidim::EmailNotificationsDigestGeneratorJob.perform_later(user.id, frequency, time: time) end end end
Version data entries
12 entries across 12 versions & 1 rubygems