From f6a2bbe9b4b044fe9b98d840b62bc09176bb57ef Mon Sep 17 00:00:00 2001 From: rainzm Date: Thu, 14 Jan 2021 17:07:19 +0800 Subject: [PATCH] feat(notify): mandatory update of VERIFY and USER_LOGIN_EXCEPTION templates --- pkg/notify/models/template.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/notify/models/template.go b/pkg/notify/models/template.go index 1f70b18cc2..f00f8a7937 100644 --- a/pkg/notify/models/template.go +++ b/pkg/notify/models/template.go @@ -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 {