Sha256: 8740e4ad6fb38c0f97db58c9164ae371ae723ae0011b868924e36836a942f166

Contents?: true

Size: 627 Bytes

Versions: 12

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    module Admin
      # A command to notify users when a role is assigned for an assembly
      class NotifyRoleAssignedToAssembly < Decidim::Command
        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
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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