MM-18274 Refactor "app/email.go" to use structured logging (#12504)
* chore: refactor to use structured logging - change fmt.sprintf method used in the logger to appropriate mlog method * implement suggested changes by removing added line during merge conflict
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
441777a4e7
Коммит
6b901773e6
10
app/email.go
10
app/email.go
@@ -347,13 +347,13 @@ func (a *App) SendInviteEmails(team *model.Team, senderName string, senderUserId
|
||||
data := model.MapToJson(props)
|
||||
|
||||
if err := a.Srv.Store.Token().Save(token); err != nil {
|
||||
mlog.Error(fmt.Sprintf("Failed to send invite email successfully err=%v", err))
|
||||
mlog.Error("Failed to send invite email successfully ", mlog.Err(err))
|
||||
continue
|
||||
}
|
||||
bodyPage.Props["Link"] = fmt.Sprintf("%s/signup_user_complete/?d=%s&t=%s", siteURL, url.QueryEscape(data), url.QueryEscape(token.Token))
|
||||
|
||||
if err := a.SendMail(invite, subject, bodyPage.Render()); err != nil {
|
||||
mlog.Error(fmt.Sprintf("Failed to send invite email successfully err=%v", err))
|
||||
mlog.Error("Failed to send invite email successfully ", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,13 +435,13 @@ func (a *App) SendGuestInviteEmails(team *model.Team, channels []*model.Channel,
|
||||
data := model.MapToJson(props)
|
||||
|
||||
if err := a.Srv.Store.Token().Save(token); err != nil {
|
||||
mlog.Error(fmt.Sprintf("Failed to send invite email successfully err=%v", err))
|
||||
mlog.Error("Failed to send invite email successfully ", mlog.Err(err))
|
||||
continue
|
||||
}
|
||||
bodyPage.Props["Link"] = fmt.Sprintf("%s/signup_user_complete/?d=%s&t=%s", siteURL, url.QueryEscape(data), url.QueryEscape(token.Token))
|
||||
|
||||
if !*a.Config().EmailSettings.SendEmailNotifications {
|
||||
mlog.Info(fmt.Sprintf("sending invitation to %v %v", invite, bodyPage.Props["Link"]))
|
||||
mlog.Info("sending invitation ", mlog.String("to", invite), mlog.String("link", bodyPage.Props["Link"].(string)))
|
||||
}
|
||||
|
||||
embeddedFiles := make(map[string]io.Reader)
|
||||
@@ -454,7 +454,7 @@ func (a *App) SendGuestInviteEmails(team *model.Team, channels []*model.Channel,
|
||||
}
|
||||
|
||||
if err := a.SendMailWithEmbeddedFiles(invite, subject, bodyPage.Render(), embeddedFiles); err != nil {
|
||||
mlog.Error(fmt.Sprintf("Failed to send invite email successfully err=%v", err))
|
||||
mlog.Error("Failed to send invite email successfully", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user