Sha256: 5c8ee8162f306a35c51fca8d13d75fe65eb72aaa787a143e6980874208182eb8

Contents?: true

Size: 686 Bytes

Versions: 12

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    module Admin
      # A command to notify users when a role is assigned for a participatory process
      class NotifyRoleAssignedToParticipatoryProcess < Decidim::Command
        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
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.27.9 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.8 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.7 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.6 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.5 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.4 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.3 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.2 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.1 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.0 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.0.rc2 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb
decidim-participatory_processes-0.27.0.rc1 app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb