提交 d49d4076 编写于 作者: 7 710leo

organize configuration

上级 c71264ab
{}
\ No newline at end of file
......@@ -58,7 +58,7 @@ func getConfigFile(name, ext string) (string, error) {
}
func init() {
filename, err := getConfigFile("login-code-sms", "tpl")
filename, err := getConfigFile("tpl/login-code-sms", "tpl")
if err != nil {
log.Fatal(err)
}
......@@ -68,7 +68,7 @@ func init() {
log.Fatalf("open %s err: %s", filename, err)
}
filename, err = getConfigFile("login-code-email", "tpl")
filename, err = getConfigFile("tpl/login-code-email", "tpl")
if err != nil {
log.Fatal(err)
}
......@@ -77,7 +77,7 @@ func init() {
log.Fatalf("open %s err: %s", filename, err)
}
filename, err = getConfigFile("password-changed-email", "tpl")
filename, err = getConfigFile("tpl/password-changed-email", "tpl")
if err != nil {
log.Fatal(err)
}
......
......@@ -182,7 +182,7 @@ func genContent(isUpgrade bool, events []*models.Event) (string, string) {
}
// 生成告警邮件
fp := path.Join(file.SelfDir(), "etc", "mail.tpl")
fp := path.Join(file.SelfDir(), "etc", "tpl", "mail.tpl")
t, err := template.ParseFiles(fp)
if err != nil {
logger.Errorf("InternalServerError: cannot parse %s %v", fp, err)
......@@ -199,7 +199,7 @@ func genContent(isUpgrade bool, events []*models.Event) (string, string) {
}
// 生成告警短信,短信和IM复用一个内容模板
fp = path.Join(file.SelfDir(), "etc", "sms.tpl")
fp = path.Join(file.SelfDir(), "etc", "tpl", "sms.tpl")
t, err = template.New("sms.tpl").Funcs(template.FuncMap{
"unescaped": func(str string) interface{} { return template.HTML(str) },
"urlconvert": func(str string) interface{} { return template.URL(str) },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册