Class: Decidim::Assemblies::Admin::NotifyRoleAssignedToAssembly

Inherits:
Rectify::Command
  • Object
show all
Defined in:
decidim-assemblies/app/commands/decidim/assemblies/admin/notify_role_assigned_to_assembly.rb

Overview

A command to notify users when a role is assigned for an assembly

Direct Known Subclasses

CreateAssemblyAdmin, UpdateAssemblyAdmin

Instance Method Summary collapse

Instance Method Details

#send_notification(user) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
# File 'decidim-assemblies/app/commands/decidim/assemblies/admin/notify_role_assigned_to_assembly.rb', line 8

def send_notification(user)
  Decidim::EventsManager.publish(
    event: "decidim.events.assembly.role_assigned",
    event_class: Decidim::RoleAssignedToAssemblyEvent,
    resource: form.current_participatory_space,
    affected_users: [user],
    extra: {
      role: form.role
    }
  )
end