Sha256: 8cc1de165389065d51bdfdef1b24e256ba40d3cc4d2f368b8de807bc722c99e1
Contents?: true
Size: 754 Bytes
Versions: 15
Compression:
Stored size: 754 Bytes
Contents
# frozen_string_literal: true module Decidim # A custom mailer for sending notifications to users when # a events are received. class NotificationMailer < Decidim::ApplicationMailer helper Decidim::ResourceHelper helper Decidim::SanitizeHelper def event_received(event, event_class_name, resource, user, user_role, extra) # rubocop:disable Metrics/ParameterLists with_user(user) do @organization = user.organization event_class = event_class_name.constantize @event_instance = event_class.new(resource: resource, event_name: event, user: user, extra: extra, user_role: user_role) subject = @event_instance.email_subject mail(to: user.email, subject: subject) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems