feat(notify): mandatory update of VERIFY and USER_LOGIN_EXCEPTION templates

This commit is contained in:
rainzm
2021-01-14 17:07:19 +08:00
parent 3e243bc2ae
commit f6a2bbe9b4

View File

@@ -146,8 +146,9 @@ func (tm *STemplateManager) GetCompanyInfo(ctx context.Context) (SCompanyInfo, e
}
var (
ForceInitType = []string{
api.EMAIL,
forceInitTopic = []string{
"VERIFY",
"USER_LOGIN_EXCEPTION",
}
notifyclientI18nTable = i18n.Table{}
defaultLang = api.TEMPLATE_LANG_CN
@@ -187,7 +188,7 @@ func (tm *STemplateManager) InitializeData() error {
for _, template := range templates {
q := tm.Query().Equals("contact_type", template.ContactType).Equals("topic", template.Topic).Equals("template_type", template.TemplateType).Equals("lang", template.Lang)
count, _ := q.CountWithError()
if count > 0 && !utils.IsInStringArray(template.ContactType, ForceInitType) {
if count > 0 && !utils.IsInStringArray(template.Topic, forceInitTopic) {
continue
}
if count == 0 {