Sha256: b9581f5579aa124f4d372e071f746a0fc8bd7f306e52e3bf53f0caf5e3439b12
Contents?: true
Size: 874 Bytes
Versions: 17
Compression:
Stored size: 874 Bytes
Contents
# frozen_string_literal: true module Decidim # A custom mailer for sending notifications to users when # a events are received. class NotificationsDigestMailer < Decidim::ApplicationMailer helper Decidim::ResourceHelper helper Decidim::SanitizeHelper SIZE_LIMIT = 10 def digest_mail(user, notification_ids) with_user(user) do notifications = Decidim::Notification.where(id: notification_ids) @user = user @organization = user.organization @notifications_digest = Decidim::NotificationsDigestPresenter.new(user) @display_see_more_message = notifications.size > SIZE_LIMIT @notifications = notifications[0...SIZE_LIMIT].map { |notification| Decidim::NotificationToMailerPresenter.new(notification) } mail(to: user.email, subject: @notifications_digest.subject) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems