[MM-32639] - Resend user invite emails (#17113)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Allan Guwatudde
2021-03-31 20:20:53 +03:00
коммит произвёл GitHub
родитель ab5925c4de
Коммит 489eaa4605
14 изменённых файлов: 325 добавлений и 0 удалений

Просмотреть файл

@@ -1220,6 +1220,24 @@ func inviteUsersToTeam(c *Context, w http.ResponseWriter, r *http.Request) {
emailList, invitesOverLimit, _ = c.App.GetErrorListForEmailsOverLimit(emailList, cloudUserLimit)
}
}
// we get the emailList after it has finished checks like the emails over the list
scheduledAt := model.GetMillis()
jobData := map[string]string{
"emailList": model.ArrayToJson(emailList),
"teamID": c.Params.TeamId,
"senderID": c.App.Session().UserId,
"scheduledAt": strconv.FormatInt(scheduledAt, 10),
}
// we then manually schedule the job
_, e := c.App.Srv().Jobs.CreateJob(model.JOB_TYPE_RESEND_INVITATION_EMAIL, jobData)
if e != nil {
c.Err = model.NewAppError("Api4.inviteUsersToTeam", e.Id, nil, e.Error(), e.StatusCode)
return
}
var invitesWithError []*model.EmailInviteWithError
var err *model.AppError
if emailList != nil {