From 195e3c5c63afaa6f9f15d6a89b498de30422e673 Mon Sep 17 00:00:00 2001 From: rainzm Date: Tue, 2 Feb 2021 16:09:27 +0800 Subject: [PATCH] feat(notify): verification email style optimization --- .../opt/yunion/share/template/content@cn/VERIFY.email | 10 +++++----- .../opt/yunion/share/template/content@en/VERIFY.email | 10 +++++----- pkg/notify/models/template.go | 1 + pkg/notify/tasks/verification_send_task.go | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build/notify/root/opt/yunion/share/template/content@cn/VERIFY.email b/build/notify/root/opt/yunion/share/template/content@cn/VERIFY.email index 69ca135634..0ec87458ea 100644 --- a/build/notify/root/opt/yunion/share/template/content@cn/VERIFY.email +++ b/build/notify/root/opt/yunion/share/template/content@cn/VERIFY.email @@ -6,12 +6,12 @@ - +
- + {{.name}}
@@ -43,7 +43,7 @@ @@ -53,10 +53,10 @@ - + - +
- 尊敬的{{.name}},您好: + 尊敬的{{.receiver_name}},您好:
如非本人操作,请及时登录平台并修改密码以保证账户的安全如非本人操作,请及时登录平台并修改密码以保证账户的安全
版权所有 © {{.copyright}} 保留一切权利版权所有 © {{.copyright}} 保留一切权利
diff --git a/build/notify/root/opt/yunion/share/template/content@en/VERIFY.email b/build/notify/root/opt/yunion/share/template/content@en/VERIFY.email index 5bf1019e19..8b3d5bbfa8 100644 --- a/build/notify/root/opt/yunion/share/template/content@en/VERIFY.email +++ b/build/notify/root/opt/yunion/share/template/content@en/VERIFY.email @@ -6,12 +6,12 @@ - +
- + {{.name}}
@@ -43,7 +43,7 @@ @@ -56,10 +56,10 @@ - + - +
- Dear {{.name}}: + Dear {{.receiver_name}}:
If you are not operating by yourself, please log in to the platform in time and change your password to ensure the security of your account.If you are not operating by yourself, please log in to the platform in time and change your password to ensure the security of your account.
Copyrights © {{.copyright}}. All rights reserved.Copyrights © {{.copyright}}. All rights reserved.
diff --git a/pkg/notify/models/template.go b/pkg/notify/models/template.go index 83a91194c9..e2c7e59c2b 100644 --- a/pkg/notify/models/template.go +++ b/pkg/notify/models/template.go @@ -128,6 +128,7 @@ type SCompanyInfo struct { LoginLogo string `json:"login_logo"` LoginLogoFormat string `json:"login_logo_format"` Copyright string `json:"copyright"` + Name string `json:"name"` } func (tm *STemplateManager) GetCompanyInfo(ctx context.Context) (SCompanyInfo, error) { diff --git a/pkg/notify/tasks/verification_send_task.go b/pkg/notify/tasks/verification_send_task.go index b66910ff34..019cd5ee84 100644 --- a/pkg/notify/tasks/verification_send_task.go +++ b/pkg/notify/tasks/verification_send_task.go @@ -54,10 +54,10 @@ func (self *VerificationSendTask) OnInit(ctx context.Context, obj db.IStandalone } data := struct { models.SCompanyInfo - Name string - Code string + ReceiverName string + Code string }{ - Name: receiver.Name, + ReceiverName: receiver.Name, Code: verification.Token, SCompanyInfo: info, }