PLT-2687 sending email on upgrade and moving profile pic to new location (#2808)

* Fixing CLI and adding unit tests

* Adding the upgrade_db_30 to the help text

* Adding the upgrade_db_30 to the help text

* Adding the upgrade_db_30 to the help text

* Fixing CLI tests

* PLT-2687 sending email on upgrade and moving profile pic to new location

* Fixing img move

* Fixing moving of profile image

* making upgrade email localizable

* Fixing email template
This commit is contained in:
Corey Hulen
2016-04-28 06:53:30 -07:00
committed by Christopher Speller
parent b49dc28d7e
commit 9fecf96d3b
7 changed files with 120 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ import (
"net/http"
l4g "github.com/alecthomas/log4go"
"github.com/nicksnyder/go-i18n/i18n"
"gopkg.in/fsnotify.v1"
)
@@ -77,9 +78,15 @@ func NewHTMLTemplate(templateName string, locale string) *HTMLTemplate {
}
func (t *HTMLTemplate) addDefaultProps() {
T := GetUserTranslations(t.Locale)
t.Props["Footer"] = T("api.templates.email_footer")
t.Html["EmailInfo"] = template.HTML(T("api.templates.email_info",
var localT i18n.TranslateFunc
if len(t.Locale) > 0 {
localT = GetUserTranslations(t.Locale)
} else {
localT = T
}
t.Props["Footer"] = localT("api.templates.email_footer")
t.Html["EmailInfo"] = template.HTML(localT("api.templates.email_info",
map[string]interface{}{"SupportEmail": Cfg.SupportSettings.SupportEmail, "SiteName": Cfg.TeamSettings.SiteName}))
}