Sha256: 9455e5a7f149bab2cd401da3037ec9e34f760d601f66fb786215a5ae4b8c2d7b

Contents?: true

Size: 595 Bytes

Versions: 7

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true
module Decidim
  # A command with the business logic to invite an user to an organization.
  class InviteUserAgain < Rectify::Command
    # Public: Initializes the command.
    #
    # form - A form object with the params.
    def initialize(user, instructions)
      @user = user
      @instructions = instructions
    end

    def call
      return broadcast(:invalid) unless user&.invited_to_sign_up?

      user.deliver_invitation(invitation_instructions: instructions)

      broadcast(:ok)
    end

    private

    attr_reader :user, :instructions
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.8.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.7 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.6 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.5 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.3 app/commands/decidim/invite_user_again.rb
decidim-core-0.0.2 app/commands/decidim/invite_user_again.rb