summaryrefslogtreecommitdiffstats
path: root/utils/html.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-04-28 06:53:30 -0700
committerChristopher Speller <crspeller@gmail.com>2016-04-28 09:53:30 -0400
commit9fecf96d3bf49e7c10cff58f656eabf829c83167 (patch)
treed7b8fc02ba39f1567fa691d0184f9d69ce6f8916 /utils/html.go
parentb49dc28d7e346e775bd75d1cce8046149440c0a4 (diff)
downloadchat-9fecf96d3bf49e7c10cff58f656eabf829c83167.tar.gz
chat-9fecf96d3bf49e7c10cff58f656eabf829c83167.tar.bz2
chat-9fecf96d3bf49e7c10cff58f656eabf829c83167.zip
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
Diffstat (limited to 'utils/html.go')
-rw-r--r--utils/html.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/utils/html.go b/utils/html.go
index e89cb12a0..7bb594e07 100644
--- a/utils/html.go
+++ b/utils/html.go
@@ -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}))
}