Sha256: a33097b933e1bcd4b274fa376bef2e8e5e331a7f50061e32e32d24ef452d1d5e
Contents?: true
Size: 839 Bytes
Versions: 10
Compression:
Stored size: 839 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 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
10 entries across 10 versions & 1 rubygems