[MM-39060] - A/B Test: Reminder to Join Workspace email (#18894)
* [MM-39060] - A/B Test: Reminder to Join Workspace email * Fix error and add error handling * feedback impl * run make i18n-extract * improvements * make i18n-extract * setup ability to do telemetry on reminder invite emails * improvement * add telemetry Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e1eb0a0cf3
Коммит
0ee2a3ca35
11
app/team.go
11
app/team.go
@@ -1286,7 +1286,7 @@ func (a *App) GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit
|
||||
return emailList, invitesNotSent, nil
|
||||
}
|
||||
|
||||
func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamID, senderId string) ([]*model.EmailInviteWithError, *model.AppError) {
|
||||
func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamID, senderId string, reminderInterval string) ([]*model.EmailInviteWithError, *model.AppError) {
|
||||
if !*a.Config().ServiceSettings.EnableEmailInvitations {
|
||||
return nil, model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
}
|
||||
@@ -1315,9 +1315,14 @@ func (a *App) InviteNewUsersToTeamGracefully(emailList []string, teamID, senderI
|
||||
inviteListWithErrors = append(inviteListWithErrors, invite)
|
||||
}
|
||||
|
||||
var reminderData *model.TeamInviteReminderData
|
||||
if reminderInterval != "" {
|
||||
reminderData = &model.TeamInviteReminderData{Interval: reminderInterval}
|
||||
}
|
||||
|
||||
if len(goodEmails) > 0 {
|
||||
nameFormat := *a.Config().TeamSettings.TeammateNameDisplay
|
||||
eErr := a.Srv().EmailService.SendInviteEmails(team, user.GetDisplayName(nameFormat), user.Id, goodEmails, a.GetSiteURL())
|
||||
eErr := a.Srv().EmailService.SendInviteEmails(team, user.GetDisplayName(nameFormat), user.Id, goodEmails, a.GetSiteURL(), reminderData)
|
||||
if eErr != nil {
|
||||
switch {
|
||||
case errors.Is(eErr, email.NoRateLimiterError):
|
||||
@@ -1472,7 +1477,7 @@ func (a *App) InviteNewUsersToTeam(emailList []string, teamID, senderId string)
|
||||
}
|
||||
|
||||
nameFormat := *a.Config().TeamSettings.TeammateNameDisplay
|
||||
eErr := a.Srv().EmailService.SendInviteEmails(team, user.GetDisplayName(nameFormat), user.Id, emailList, a.GetSiteURL())
|
||||
eErr := a.Srv().EmailService.SendInviteEmails(team, user.GetDisplayName(nameFormat), user.Id, emailList, a.GetSiteURL(), nil)
|
||||
if eErr != nil {
|
||||
switch {
|
||||
case errors.Is(eErr, email.NoRateLimiterError):
|
||||
|
||||
Ссылка в новой задаче
Block a user