Sha256: 4c476b41260ec86e7dfd2e9ed8c178e4a46764c387c8f6b4453c2e2df07ef0df
Contents?: true
Size: 931 Bytes
Versions: 28
Compression:
Stored size: 931 Bytes
Contents
module Workarea module Admin class StatusReportMailer < Admin::ApplicationMailer add_template_helper(InsightsHelper) def self.report_to_many(users) alerts = AlertsViewModel.wrap(Alerts.new) dashboard = Dashboards::IndexViewModel.new users.map do |user| report(user.email, user: user, alerts: alerts, dashboard: dashboard) end end def report(email, user: nil, alerts: nil, dashboard: nil) @date = Time.current - 1.day @user = user || User.find_by_email(email) @alerts = alerts || AlertsViewModel.wrap(Alerts.new) @dashboard = dashboard || Dashboards::IndexViewModel.new mail( to: email, from: Workarea.config.email_from, subject: t( 'workarea.admin.status_report_mailer.subject', site: Workarea.config.site_name ) ) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems