signup: fix email sent logic for tempuser

Fixes #8656 and properly sets the email_sent and email_sent_on fields
for a tempuser (signup user).
This commit is contained in:
Daniel Lee
2017-06-30 20:21:08 +02:00
parent fb99ddf295
commit b8aa203707
6 changed files with 46 additions and 1 deletions
+5
View File
@@ -78,6 +78,11 @@ func AddOrgInvite(c *middleware.Context, inviteDto dtos.AddInviteForm) Response
return ApiError(500, "Failed to send email invite", err)
}
emailSentCmd := m.UpdateTempUserWithEmailSentCommand{Code: cmd.Result.Code}
if err := bus.Dispatch(&emailSentCmd); err != nil {
return ApiError(500, "Failed to update invite with email sent info", err)
}
return ApiSuccess(fmt.Sprintf("Sent invite to %s", inviteDto.LoginOrEmail))
}