Sha256: 9fc3e4145295e9c2d6f958c9efe1ed6da0493461fff5e6afa6d2204e7aaf34a0
Contents?: true
Size: 719 Bytes
Versions: 20
Compression:
Stored size: 719 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 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
20 entries across 20 versions & 1 rubygems