Skip to content


The Kiqr::Services::Invitations::Create service class is crafted to facilitate the process of sending invitations within the Kiqr platform. It encapsulates the logic for saving an invitation and sending out an invitation email.


To utilize this service, you need to supply an instance of an invitation and a user. The service will then attempt to save the invitation and, in the future, send an invitation email.

@invitation =

if @invitation.valid?!(invitation: @invitation, user: current_user)
  kiqr_flash_message(:notice, :invitation_sent, email:
  redirect_to account_invitations_path(account_id: current_account)
  render :new, status: :unprocessable_entity


  • invitation: An instance of the invitation you are attempting to send. This should be a new, unsaved ActiveRecord object.
  • user: The user responsible for sending the invitation. This should be a persisted ActiveRecord object, indicating the sender of the invitation.


Upon invocation, the service attempts to save the provided invitation within a database transaction and send an invitation email to the recipient.