fix: send confirmation email on re-adding agent (#5279)

Send confirmation email after re-adding the agent.

Fixes: #4951
This commit is contained in:
Tejaswini Chile
2022-08-18 13:12:43 +05:30
committed by GitHub
parent 0cd08065d1
commit ea918d9c5a
3 changed files with 21 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
# TODO: move this to a builder and combine the save account user method into a builder
# ensure the account user association is also created in a single transaction
def create_user
return if @user
return @user.send_confirmation_instructions if @user
@user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))
end