Class: Decidim::ParticipatoryProcesses::Admin::NotifyRoleAssignedToParticipatoryProcess

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

Overview

A command to notify users when a role is assigned for a participatory process

Instance Method Summary collapse

Instance Method Details

#send_notification(user) ⇒ Object


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

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