Migrating AppError to error for mailservice (#16810)
* Migrating AppError to error for mailservice * Updating i18n strings * Fixing shadow variable problem * Addressing PR review comments * fixing test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
572f861675
Коммит
fbe0294e86
@@ -731,7 +731,11 @@ func (api *PluginAPI) SendMail(to, subject, htmlBody string) *model.AppError {
|
||||
return model.NewAppError("SendMail", "plugin_api.send_mail.missing_htmlbody", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return api.app.Srv().EmailService.sendNotificationMail(to, subject, htmlBody)
|
||||
if err := api.app.Srv().EmailService.sendNotificationMail(to, subject, htmlBody); err != nil {
|
||||
return model.NewAppError("SendMail", "plugin_api.send_mail.missing_htmlbody", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Plugin Section
|
||||
|
||||
Ссылка в новой задаче
Block a user